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

Cross-targetting apps get wrong version of NETStandard.Library on .NETFramework #614

Closed
natemcmaster opened this issue Jan 9, 2017 · 3 comments
Assignees
Milestone

Comments

@natemcmaster
Copy link
Contributor

When packing a project that targets .NETStandard and .NETFramework, the package can easily end up with different version of NETStandard.Library based on TFM.

Repro:

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

  <PropertyGroup>
    <TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="NETStandard.Library" Version="1.6.2-*"/>
  </ItemGroup>

</Project>

dotnet pack produces the following dependencies:

    <dependencies>
      <group targetFramework=".NETFramework4.5.1">
        <dependency id="NETStandard.Library" version="1.6.2-beta-24903-02" exclude="Build,Analyzers" />
      </group>
      <group targetFramework=".NETStandard1.3">
        <dependency id="NETStandard.Library" version="1.6.0" exclude="Build,Analyzers" />
      </group>
    </dependencies>

Using CLI 1.0.0-preview5-004468.

@Eilon
Copy link
Member

Eilon commented Jan 10, 2017

Adding Blocking Partner label because this is blocking ASP.NET.

@srivatsn srivatsn added this to the 1.0 RC3 milestone Jan 10, 2017
@srivatsn srivatsn added the Bug label Jan 10, 2017
@dsplaisted
Copy link
Member

Can you add the following to the PropertyGroup?

<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>

Then it should use the version specified in your project file.

With #600, we are planning to generate error messages if the same item is specified multiple times which will tell you how to disable the implicit items if you want.

@natemcmaster
Copy link
Contributor Author

Yes using DisableImplicitFrameworkReferences does the trick. I'm closing at it appears to be a duplicate of #596 and #600

mmitche pushed a commit to mmitche/sdk that referenced this issue Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants