Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Could not load file or assembly 'System.Runtime, when creating nuget spec based on the assembly

$
0
0

I have a simple compiled library (compiled with very different TFs) that I want to provide for consumers via nugets.For this purpose I want to use nuget spec -a {libraryPath} command to create nuspec (and then nuget pack to create an actual nuget).

Apperently nuget spec command (version without arguments and with -a) doesn't generate a valid/filled nuspec file and instead always creates just an empty template.

So I have 2 questions:

  1. What's the difference between nuget spec and nuget spec -a {libraryPath}? As I understand in both of cases, the only generated output is empty nuspec file?

  2. Sometimes nuget spec -a {libraryPath} works well, but in some cases it throws error like:

    c:\test>nuget spec -a ConsoleApp1.dllCould not load file or assembly 'file:///c:\test\ConsoleApp1.dll' or one of its dependencies. The system cannot find the file specified.

where ConsoleApp1.dll is output from consoleapp project with <TargetFramework>net6.0</TargetFramework>:

or:

 c:\test>nuget spec -a SuperTest1.dll Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=..' or one of its dependencies. The system cannot find the file specified.

where SuperTest.dll is output from classlibrary project (empty) with <TargetFramework>netcoreapp3.1</TargetFramework>

How to fix such errors?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>