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

NU1201 for netcoreapp2.0 -> net461 project dependency using new csproj format/sdk, but not for classic csproj #5461

Closed
Tratcher opened this issue Jun 20, 2017 · 10 comments
Assignees
Labels
Milestone

Comments

@Tratcher
Copy link

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):
dotnet --version => 2.0.0-preview2-006479

VS version (if appropriate): 15.3 preview3 [26615.0.d15rel]

OS version (i.e. win10 v1607 (14393.321)): Win7 SP1

Worked before? Unknown

Detailed repro steps so we can see the same problem

Repro app: NetRef.zip

  1. Create a new .NET Core Console App targeting netcoreapp2.0
  2. Create a new .NET Core Class Library, edit the csproj, and change the TargetFramework to net461 (the same error occurs with net45-net47).
  3. Add the class library as a dependency on the console app and build the project.

Result:
Error NU1201 Project ClassCoreSdk is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Project ClassCoreSdk supports: net461 (.NETFramework,Version=v4.6.1)

Other suggested things

  • VS Intellesence works for this dependency, so the compiler appears to think it's valid.
  • If I instead create a .NET Framework Class Library (e.g. classic .csproj format) targeting .NET 4.6.1 (or any other version) and add it as a dependency then it works fine.

Verbose Logs

logdump.txt

@Tratcher Tratcher changed the title NU1201 for net461 project dependency using new csproj format/sdk, but not for classic csproj NU1201 for netcoreapp2.0 -> net461 project dependency using new csproj format/sdk, but not for classic csproj Jun 20, 2017
@analogrelay
Copy link

/cc @rrelyea @davidfowl @Eilon @muratg

@rrelyea rrelyea added this to the 4.3 milestone Jun 20, 2017
@rrelyea
Copy link
Contributor

rrelyea commented Jun 20, 2017

Let's understand and fix in post V15.3P3/CLI2P2.
@anurse - let us know if you think this is a V15.3P3/CLI2P2 blocker.

@analogrelay
Copy link

I think we can avoid having it for CLI2P2. It only affects .NET Framework projects using the new SDK-based project system, which is rare, since existing projects will use the older project system.

@rrelyea rrelyea added the Resolution:ByDesign This issue appears to be ByDesign label Jul 10, 2017
@rrelyea
Copy link
Contributor

rrelyea commented Jul 10, 2017

This is because packages.config projects do not check compatibility during restore. Which is by design.
Build still fails for that scenario.

@rrelyea rrelyea closed this as completed Jul 10, 2017
@valeriob
Copy link

valeriob commented Sep 1, 2017

Hi,
what's the story about this scenario, is it going to be supported ?
Thanks

@casfnq
Copy link

casfnq commented Sep 6, 2017

@anurse you might think it's rare, but we have a 700 project solution, and converting over existing libraries to .netstandard, so I have 45 errors of NU1201, so not so rare for me. As others move to the new format or create .netstandard projects then this will increase. @rrelyea if it is by design, what is the workaround?

@MisinformedDNA
Copy link

  • Created a new .NET Core 2.0 class library
  • Created a new Azure Function in .NET 4.6.1 (Functions don't yet support .NET Core)
  • Make the Azure Function reference the class library (Note: No Nuget)

EXPECTED: Successfully added reference since they are both support .NET Standard 2.0
ACTUAL: Error NU1201 (same as OP)

Since they both support .NET Standard, there has to be a way to reference each other, right?

@Eirenarch
Copy link

Eirenarch commented Sep 26, 2017

I have hit this too trying to migrate existing project to .NET standard and the new project system. If I have old-school project file I can reference the net461 project from the .NET Standard class library if I use the new format I get the NU1201 error. Anyone found a workaround?

@mishra14
Copy link
Contributor

Folks, thanks for your feedback! This issue appears to be identical to dotnet/standard#481

Please see that issue for workarounds and plan for the future.

@jasmeet321
Copy link

I have one class library project as my repository layer that in .netcore 2,0 framework and i am consuming this dll in Azure function project and its giving issue below

Severity Code Description Project File Line Suppression State
Error NU1201 Project Gamification.Services is not compatible with net461 (.NETFramework,Version=v4.6.1). Project Gamification.Services supports: netcoreapp2.0 (.NETCoreApp,Version=v2.0) TurnamentTimerFunctionApp E:\SportsFoundation\TurnamentTimerFunctionApp\TurnamentTimerFunctionApp.csproj 1

can anyone help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants