1
votes

I've created a NuGet package which includes files from a solution where each class libary shows a "Target Framework" of 4.6.1 in Properties > Application > Target Framework.

I'm trying to add a reference to this NuGet package into a solution where each class libary shows a "Target Framework" of 4.6.1 in Properties > Application > Target Framework.

But when I try to add a reference to the NuGet package into my solution described above, I get the following error:

"Could not install package 'Janus.SecurityApi.Framework 1.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author."

Any idea what the issue might be here? Based on the parameters that I described above, it seems like this should work as expected?

1
Can you post the .nuspec file that is contained in the .nupkg file as a edit to your question. just open the .nupkg file with any program that can uncompress .zip files and you can get the file that way. Or if you are having trouble rename the .nupkg file to .zip and just double click it. The thing we want to know is what is under the <dependencies> tag.Scott Chamberlain

1 Answers

2
votes

Looks like this addition to the .nuspec file fixed the issue:

<frameworkAssemblies>
  <frameworkAssembly assemblyName="Microsoft.CSharp" />
</frameworkAssemblies>