Skip to content
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

[One .NET] exclude Microsoft.AspNetCore.App.Runtime.linux-* packages #6207

Merged

Conversation

jonathanpeppers
Copy link
Member

Context: dotnet/sdk#19891

If you dotnet new android and dotnet build it without a
NuGet.config you hit:

error NU1102: Unable to find package Microsoft.AspNetCore.App.Runtime.linux-arm64 with version (= 6.0.0-rc.1.21417.2)

I found I could workaround the problem by removing linux-* packages
at a certain point during the build:

<Target Name="_RemoveLinuxFrameworkReferences"
    AfterTargets="ProcessFrameworkReferences">
  <ItemGroup>
    <_ProblematicRIDs Include="linux-arm;linux-arm64;linux-x86;linux-x64" />
    <PackageDownload Remove="Microsoft.AspNetCore.App.Runtime.%(_ProblematicRIDs.Identity)" />
    <PackageDownload Remove="Microsoft.NETCore.App.Host.%(_ProblematicRIDs.Identity)" />
  </ItemGroup>
</Target>

With this target in place, I can build projects without a
NuGet.config file. Let's put this workaround in place until we have
another solution for dotnet/sdk#19891.

To validate these changes, I removed any instances of the dotnet6
feed in our MSBuild tests.

Context: dotnet/sdk#19891

If you `dotnet new android` and `dotnet build` it without a
`NuGet.config` you hit:

    error NU1102: Unable to find package Microsoft.AspNetCore.App.Runtime.linux-arm64 with version (= 6.0.0-rc.1.21417.2)

I found I could workaround the problem by removing `linux-*` packages
at a certain point during the build:

    <Target Name="_RemoveLinuxFrameworkReferences"
        AfterTargets="ProcessFrameworkReferences">
      <ItemGroup>
        <_ProblematicRIDs Include="linux-arm;linux-arm64;linux-x86;linux-x64" />
        <PackageDownload Remove="Microsoft.AspNetCore.App.Runtime.%(_ProblematicRIDs.Identity)" />
        <PackageDownload Remove="Microsoft.NETCore.App.Host.%(_ProblematicRIDs.Identity)" />
      </ItemGroup>
    </Target>

With this target in place, I can build projects without a
`NuGet.config` file. Let's put this workaround in place until we have
another solution for dotnet/sdk#19891.

To validate these changes, I removed any instances of the `dotnet6`
feed in our MSBuild tests.
@jonathanpeppers jonathanpeppers force-pushed the linux-frameworkreference branch from 2b9a6c6 to d3bb135 Compare August 19, 2021 21:42
@jonathanpeppers jonathanpeppers marked this pull request as ready for review August 20, 2021 03:13
@jonathanpeppers jonathanpeppers merged commit 3f052b5 into dotnet:main Aug 20, 2021
@jonathanpeppers jonathanpeppers deleted the linux-frameworkreference branch August 20, 2021 14:21
jonathanpeppers added a commit that referenced this pull request Aug 20, 2021
…6207)

Context: dotnet/sdk#19891

If you `dotnet new android` and `dotnet build` it without a
`NuGet.config` you hit:

    error NU1102: Unable to find package Microsoft.AspNetCore.App.Runtime.linux-arm64 with version (= 6.0.0-rc.1.21417.2)

I found I could workaround the problem by removing `linux-*` packages
at a certain point during the build:

    <Target Name="_RemoveLinuxFrameworkReferences"
        AfterTargets="ProcessFrameworkReferences">
      <ItemGroup>
        <_ProblematicRIDs Include="linux-arm;linux-arm64;linux-x86;linux-x64" />
        <PackageDownload Remove="Microsoft.AspNetCore.App.Runtime.%(_ProblematicRIDs.Identity)" />
        <PackageDownload Remove="Microsoft.NETCore.App.Host.%(_ProblematicRIDs.Identity)" />
      </ItemGroup>
    </Target>

With this target in place, I can build projects without a
`NuGet.config` file. Let's put this workaround in place until we have
another solution for dotnet/sdk#19891.

To validate these changes, I removed any instances of the `dotnet6`
feed in our MSBuild tests.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants