我有一个针对 .NET Framework 4 的项目。我正在使用nuget.exe(version 5.6.0.6591) 创建 NuGet 包。Microsoft.CSharp项目本身除了程序集之外没有其他引用System(这些都没有特定的版本集)。
首先,我创建了一个MyProject.nuspec文件(通过nuget spec在MyProject.csproj文件夹中运行)。然后我尝试运行nuget pack MyProject.csproj并获取 NuGet 包(.nupkg存档)。但我也收到了这个警告:
WARNING: NU5128: Some target frameworks declared in the dependencies group of the nuspec and the lib/ref folder do not have exact matches in the other location. Consult the list of actions below:
- Add a dependency group for .NETFramework4.0 to the nuspec
Run Code Online (Sandbox Code Playgroud)
根据https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu5128,我修改了我的.nuspec文件,现在它看起来像这样(注意标签<dependencies> …