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

Restore on .NET Core 2.0 project imports .NET Framework 3.5 package targets #5149

Closed
natemcmaster opened this issue May 1, 2017 · 3 comments
Assignees
Labels
Functionality:Restore Resolution:External This issue appears to be External to nuget Type:Bug
Milestone

Comments

@natemcmaster
Copy link

Details about Problem

NuGet product used: dotnet
NuGet version: 4.3.0-preview1
dotnet.exe --version: 2.0.0-preview1-005861

Detailed repro steps so we can see the same problem

Run dotnet restore on this:

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="SQLitePCLRaw.lib.e_sqlite3.linux" Version="1.1.4" />
  </ItemGroup>

</Project>

SQLitePCLRaw.lib.e_sqlite3.linux contains a file in build/net35/SQLitePCLRaw.lib.e_sqlite3.linux.targets

Expected

obj/*.csproj.nuget.g.targets does not contain an import to the build/net35/ targets file.

Actual

obj/*.csproj.nuget.g.targets contains:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
  </PropertyGroup>
  <ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
    <Import Project="$(NuGetPackageRoot)sqlitepclraw.lib.e_sqlite3.linux/1.1.4/build/net35/SQLitePCLRaw.lib.e_sqlite3.linux.targets" Condition="Exists('$(NuGetPackageRoot)sqlitepclraw.lib.e_sqlite3.linux/1.1.4/build/net35/SQLitePCLRaw.lib.e_sqlite3.linux.targets')" />
    <!-- .... -->
  </ImportGroup>
</Project>

cc @JunTaoLuo @ericsink @emgarten @kichalla

@natemcmaster
Copy link
Author

FYI - this bug does not appear when targeting netcoreapp1.x.

@natemcmaster
Copy link
Author

Closing as external to NuGet. It looks like this is caused by Microsoft.NET.Sdk setting PackageTargetFallback to include net461 on .NET Core 2.0. dotnet/sdk#1133

@natemcmaster
Copy link
Author

Moved to dotnet/sdk#1166.

@rrelyea rrelyea added the Resolution:External This issue appears to be External to nuget label Aug 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Restore Resolution:External This issue appears to be External to nuget Type:Bug
Projects
None yet
Development

No branches or pull requests

3 participants