Skip to content

Add <frameworkReferences> metadata to nuspec of packages that depend on the shared framework #10429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2019

Conversation

natemcmaster
Copy link
Contributor

Workaround for #4257. This hacks the <frameworkReference> metadata into packages which depend on a framework-only assembly because we can't update our build to use <FrameworkReference> in .csproj just yet.

This is part of resolving https://github.com/dotnet/cli/issues/10666.

Expected output: any package which depends on Microsoft.AspNetCore.App should have this in its nuspec:

<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
  <metadata>
    <!-- ... -->

    <frameworkReferences>
      <group targetFramework=".NETCoreApp3.0">
        <frameworkReference name="Microsoft.AspNetCore.App" />
      </group>
    </frameworkReferences>
  </metadata>
</package>

@natemcmaster natemcmaster requested a review from a team as a code owner May 21, 2019 22:21
@natemcmaster natemcmaster added the feature-platform Deprecated: Cross-cutting issues related to ASP.NET Core as a platform label May 21, 2019
@natemcmaster natemcmaster changed the title Add <frameworkReferences> metadata to package nuspec Add <frameworkReferences> metadata to nuspec of packages that depend on the shared framework May 22, 2019
@natemcmaster natemcmaster merged commit 9c84558 into dotnet:master May 22, 2019
@natemcmaster natemcmaster deleted the fx-ref-nuspec branch May 22, 2019 02:16
new XElement(ns + "frameworkReferences",
new XElement(ns + "group",
new XAttribute("targetFramework", NuGetFramework.Parse(SharedFrameworkTargetFramework).GetFrameworkString()),
new XElement(ns + "frameworkReference", new XAttribute("name", "Microsoft.AspNetCore.App")))));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprised the package builder can't be used here. Would be nice to avoid reaching down into the XML.

Is there an issue open somewhere in the NuGet world on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-platform Deprecated: Cross-cutting issues related to ASP.NET Core as a platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants