1

I used NuGet Package Explorer (for the first time) to create a .nupkg to share with others. I have one DLL that targets NetStandardLibrary 2.0, But when I try to add the package I receive the following error:

Could not install package 'iCANMVCSDK 1.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.7.2', 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.

I thought that by using NETStandard 2.0 it could be installed in any .NET app. I also tried adding additional assemblies:

enter image description here

I rebuild, repackage, and I still get the same error. What am I missing?

I tried editing the project file like this:

    <TargetFrameworks>netstandard2.0;net472</TargetFrameworks>

When I try to build after adding net472, I receive the following error:

The type or namespace name 'Http' does not exist in the namespace 'System.Net'

What really makes no sense to me is that I can add the DLL directly into the project (the one that targes NET 4.72) and it works as expected. The problem is when attempting to install it as a NuGet package.

Rani Radcliff
  • 4,856
  • 5
  • 33
  • 60
  • when creating a project, I can choose either core or classic. how you configure the new project (project type, .net version)? – Alexey Obukhov May 05 '22 at 17:36
  • It is a Class Library and I selected NETStandard 2.0 as target – Rani Radcliff May 05 '22 at 17:40
  • what library you try to add? I can't find "iCANMVCSDK" anywhere. what is her full name or nuget link? – Alexey Obukhov May 05 '22 at 18:01
  • I created the package. It is on my harddrive. I am testing the nuget package by trying to install it an an empty project, but it keeps telling me that it is missing assembly reference. When I changed the TargetFrameworks in the project file, I get an extra folder for net472 in my bin folder, but it is empty. the DLL only creates in the nestandard 2.0folder – Rani Radcliff May 05 '22 at 18:06

0 Answers0