NuGet Warning NU5501

Scenario 1

The following dependency group(s) require(s) dots in the framework version: net50-windows7.0

Issue

The dependency group framework must included dots in their framework version number. This is required for frameworks newer than net5.0.

This issue generally occurs when a nuspec is authored manually, like for example:

  <metadata>
      <dependencies>
          <group targetFramework="net50-windows7.0">
              <dependency id=""Dependency"" version=""1.0.0"" />
          </group>
      </dependencies>
  </metadata>

Solution

Change net50 to net5.0.

  <metadata>
      <dependencies>
          <group targetFramework="net5.0-windows7.0">
              <dependency id=""Dependency"" version=""1.0.0"" />
          </group>
      </dependencies>
  </metadata>

Scenario 2

The following packaged file folder(s) require(s) dots in the framework version: contentFiles/any/net50/a.img. 

Issue

The folders denoting a framework must included dots in their framework version number. This is required for frameworks newer than net5.0.

This issue generally occurs when manually adding items to a package, using something like the following in your .csproj:

<ItemGroup>
  <None Include="a.img" Pack="true" PackagePath="contentFiles/any/net50" />
</ItemGroup>

or a nuspec:

  <files>
    <file src="resources/a.img" target="contentFiles/any/net50" />
  </files>

Solution

Change net50 to net5.0.

<ItemGroup>
  <None Include="a.img" Pack="true" PackagePath="contentFiles/any/net5.0" />
</ItemGroup>

or the nuspec:

  <files>
    <file src="resources/a.img" target="contentFiles/any/net5.0" />
  </files>