oleg-shilo / cs-script

C# scripting platform
http://www.cs-script.net
MIT License
1.61k stars 235 forks source link

css_nuget cannot load cs script source #340

Open mogqai opened 1 year ago

mogqai commented 1 year ago

I have tried to load with "//css_nuget -ng:"-s https://artifactory.......local" CS-Package" a package to my Visual Studio project. Cannot load and use this package. Only when I load it with Visual Studio Nuget manager it will run. The package contain only a cs script source file which should be included to the project. Docu of css-nuget says only assemblies. Is this right?

oleg-shilo commented 1 year ago

You have asked two questions:

  1. Passing that package restore arguments I have checked and that argument is correctly passed to the package manager (dotnet.exe)

    image However, if the package happens to be already present on your system then cs-script will take it from there instead of downloading. Thus I suggest you clear the nuget cache.

  2. "css-nuget says only assemblies" Yes, it is correct. cs files in that package are applicable for the VS project structure. But cs-script model does not use a persistent project structure but only a virtual project. You will need to distribute your scripts by some other means.

    If you are indeed very keen to download your scripts then you can write a simple pre-script that downloads your package, unpacks it (it is just a zip file after all) and adds an import statement to your script for that new script file from the package.

    https://www.cs-script.net/cs-script/help-legacy/precompilers.html