Skip to content

Framework assemblies are no longer added to .nuspec when using the new .csproj project system #4853

@kevinchalet

Description

@kevinchalet

Moved from #4412 (comment):


In the marvelous world of project.json, specifying a frameworkAssemblies node was enough to tell NuGet to add the corresponding entries in the .nuspec file:

{
  "frameworks": {
    "net451": {
      "frameworkAssemblies": {
        "System.IdentityModel": "4.0.0.0",
        "System.Xml": "4.0.0.0"
      }
    }
  }
}
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
  <metadata>
    // ...
    <frameworkAssemblies>
      <frameworkAssembly assemblyName="System.IdentityModel" targetFramework=".NETFramework4.5.1" />
      <frameworkAssembly assemblyName="System.Xml" targetFramework=".NETFramework4.5.1" />
    </frameworkAssemblies>
  </metadata>
</package>

With .csproj, this is no longer true when using Reference:

<Project Sdk="Microsoft.NET.Sdk">

  <ItemGroup>
    <Reference Include="System.IdentityModel" />
    <Reference Include="System.Xml" />
  </ItemGroup>

</Project>

This breaking change has obviously important implications, as framework assemblies are no longer brought transitively, which means that the final user of the package has to reference the framework assemblies in his own app.

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions