Calling NuGet fails

127 views
Skip to first unread message

uwe....@gmail.com

unread,
Mar 21, 2016, 4:26:33 AM3/21/16
to CS-Script
This is strange: I've just set up a new Windows 10 PC.

This one worked successfully in the past:

//css_nuget -ng:"-Source http://nuget.example.com:81/nuget" ZetaFileSync.MyPackage

Now, on the new PC it fails with:

NuGet> Processing NuGet packages...
Error: Specified file could not be compiled.
System.ApplicationException: Cannot process NuGet package 'ZetaFileSync.MyPackage'
   bei csscript.NuGet.Resolve(String[] packages, Boolean supressDownloading, String script)
   bei csscript.CSExecutor.AggregateReferencedAssemblies(ScriptParser parser)
   bei csscript.CSExecutor.Compile(String scriptFileName)
   bei csscript.CSExecutor.ExecuteImpl()

Trying the following from the Windows command line:

nuget.exe install -Source "http://nuget.example..com:81/nuget" ZetaFileSync.MyPackage

This one succeeds!



So I really do not understand why the above one fails.

Might it be possible that the Source parameter is not correctly passed to the NuGet call?

uwe....@gmail.com

unread,
Mar 21, 2016, 5:03:42 AM3/21/16
to CS-Script, uwe....@gmail.com
After debugging the NuGet sources, I found out:

When calling my cs-script, I was missing the follwoing line:

SET CSSCRIPT_DIR=\\myserver\myshare\cs-script

Thus, the NuGetExe property of CS-Script returned NULL, which in turn let the NuGet.exe call fail.

After adding the line, everything works correctly.

Oleg Shilo

unread,
Mar 22, 2016, 12:55:37 AM3/22/16
to cs-s...@googlegroups.com
I am glad it's all sorted. :)

Sorry I couldn't investigate the issue yesterday.

After reviewing the code I decided to provide some extra feedback. Now (with the next release) the script engine prints a warning if nuget.exe was not found: 

Warning: Cannot find 'nuget.exe'. Ensure it is in the application directory or in the %CSSCRIPT_DIR%/lib


Cheers,
Oleg

Oleg Shilo
--------------------------------------------------------------------------------------------
Website: http://www.csscript.net
E-Mail: csscript...@gmail.com

--
You received this message because you are subscribed to the Google Groups "CS-Script" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cs-script+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Uwe Keim

unread,
Mar 22, 2016, 2:05:01 AM3/22/16
to cs-s...@googlegroups.com
Thank you very much, Oleg!


Shawn Pierce

unread,
May 24, 2017, 5:20:26 PM5/24/17
to CS-Script, uwe....@gmail.com
This looks very interesting. Internally I would want to host my own server, I'm curious if you guys have any comments on how it would work if I wanted it to grab a new version automatically if the version of the DLL was updated at the source.

Oleg Shilo

unread,
May 24, 2017, 10:08:36 PM5/24/17
to cs-s...@googlegroups.com
It should work right away. You can modify your system wide %APPDATA%\NuGet\NuGet.Config and put your repository on top. This is arguably the simplest way. 

Alternatively you can create your own config and pass it to the nuget.exe as a nuget specific parameter. Something like this:

//css_nuget -ng:"-configfile c:\my.config" <package name>

Reply all
Reply to author
Forward
0 new messages