cs-script icon indicating copy to clipboard operation
cs-script copied to clipboard

//css_ref vs -r::

Open d3nd3 opened this issue 9 months ago • 3 comments

I expect that -r:C:\somedll.dll would do the same thing as `//css_ref C:\somedll.dll

I am using this in sublime text editor. Only //css_ref works, but I dont' want to put that at the top of every file. I have tried:

dotnet cscs.dll -config:set:SearchDirs=add:

dotnet cscs.dll -config:set:DefaultArguments=add:-dir:

dotnet cscs.dll -config:set:DefaultArguments=add:-r:

Only //css_ref is making the Intellisense for that reference work! What am I doing wrong? And yes I confirmed those things with the CS-Script config output in sublime.

You can avoid referencing the most common assemblies in every script by setting them as default referenced assemblies in the CS-Script config file (ContextMenu > CS-Script > Settings > CS-Script Config). Basically I can't do this. It doesn't work for me.

OS: Windows 11 dotnet --version 8.0.205


"C:\Program Files (x86)\dotnet\sdk\7.0.409\Roslyn\bincore\csc.dll" exists after installing .NET 7 SDK , yet

AppData\Roaming\Sublime Text\Packages\User\cs-script\cs-script_v1.3.3>cscs.exe
C# Script execution engine (.NET Core). Version 4.6.2.0.
Copyright (C) 2004-2020 Oleg Shilo. www.csscript.net (github.com/oleg-shilo/cs-script)

   CLR:             7.0.19
   System:          Microsoft Windows NT 10.0.22631.0
   Architecture:    x64
   Install dir:     <not integrated>
   Script engine:   C:\Users\dendi\AppData\Roaming\Sublime Text\Packages\User\cs-script\cs-script_v1.3.3\cscs.dll
   Config file:     C:\Users\dendi\AppData\Roaming\Sublime Text\Packages\User\cs-script\cs-script_v1.3.3\css_config.xml
   Compiler engine: dotnet (C:\Program Files\dotnet\dotnet.exe)
                    WARNING: .NET 7 SDK cannot be found. It's required for `csc` and `dotnet` compiler engines.
   NuGet manager:   dotnet
   NuGet cache:     <not found>
   Custom commands: C:\ProgramData\cs-script\commands
   Global includes: C:\ProgramData\cs-script\inc

Could this warning be related? It can't find the csc.dll , yet its there, hm.

Nevermind this is because cscs.exe is x64 and cscs.dll is x86. Yet my default dotnet.exe is x64. "C:\Program Files (x86)\dotnet\dotnet.exe" cscs.dll

AppData\Roaming\Sublime Text\Packages\User\cs-script\cs-script_v1.3.3>"C:\Program Files (x86)\dotnet\dotnet.exe" cscs.dll
C# Script execution engine (.NET Core). Version 4.6.2.0.
Copyright (C) 2004-2020 Oleg Shilo. www.csscript.net (github.com/oleg-shilo/cs-script)

CLR:             7.0.19
System:          Microsoft Windows NT 10.0.22631.0
Architecture:    x86
Install dir:     <not integrated>
Script engine:   C:\Users\dendi\AppData\Roaming\Sublime Text\Packages\User\cs-script\cs-script_v1.3.3\cscs.dll
Config file:     C:\Users\dendi\AppData\Roaming\Sublime Text\Packages\User\cs-script\cs-script_v1.3.3\css_config.xml
Compiler engine: dotnet (C:\Program Files (x86)\dotnet\dotnet.exe)
NuGet manager:   dotnet
NuGet cache:     <not found>
Custom commands: C:\ProgramData\cs-script\commands
Global includes: C:\ProgramData\cs-script\inc

I replaced references of dotnet with the full path to the x86 dotnet within cs-script.py for the sublime package. I still can't get the behaviour I want.

My goal is specifically for the UnityEngine.dll. From reading the docs I understand that on windows using UnityEngine with correct include dir should be enough.

d3nd3 avatar May 24 '24 11:05 d3nd3