Closed gojimmypi closed 5 years ago
Package 'ilmerge 3.0.21' is not found in the following primary source(s): 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'. Please
verify all your online package sources are available (OR) package id, version are specified correctly.
Please re-read the error message, not the irrelevant GitHub thread.
You don't have a valid NuGet feed (like NuGet.org) for VS to locate ILMerge, and that's why it fails.
Thank you. I did read the error message.
If I right-click on references, and select Manage NuGet Packages...
it has this setting:
Is there someplace else that I need to tell Visual Studio to set the NuGet feed?
That goes far beyond the scope of ILMerge. But to get rid of VS's illusion, you can run the NuGet command line tool at the root of that project to see the effective feed list (based on messy NuGet configuration system),
nuget sources list
At the package manager prompt? I get an error:
PM> nuget sources list
nuget : The term 'nuget' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
At line:1 char:1
+ nuget sources list
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (nuget:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PM>
I also tried just sources list
PM> sources list
sources : The term 'sources' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
At line:1 char:1
+ sources list
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (sources:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PM>
Ugh. There actually is a second place to set the package source. :/
In addition to the documented "right-click on references" mentioned above, there's another setting in the package manager console itself that I didn't notice. Apparently the default is the offline storage, regardless of settings in NuGet Package Manager.
And like most things, obvious when you know the answer, lol.
I added some installation instructions to help others avoid this problem of two places to set the package source:
https://github.com/dotnet/ILMerge#installation
While I was there, also added some instructions for a batch file that does not use msbuild
:
https://github.com/dotnet/ILMerge#to-run-ilmerge-in-a-batch-file
I installed Visual Studio 2019 today, and tried to add the
ILMerge
tool usingInstall-Package ilmerge -Version 3.0.21
and received aInstall-Package : Package 'ilmerge 3.0.21' is not found
error.Here's the full log of install attempt:
There's this year-old open issue for NuGet: https://github.com/NuGet/Home/issues/1827 I cleared the cache as suggested, but no luck.
Does ILMerge work with Visual Studio 2019, or are there other ideas on how to make a single, stand-alone, portable
exe
file without needing all the other DLL's in the same directory?