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

Get three warnings when you add an incompatible project reference from a legacy project system -> new project system #266

Closed
davkean opened this issue Oct 13, 2016 · 9 comments
Assignees
Labels
Milestone

Comments

@davkean
Copy link
Member

davkean commented Oct 13, 2016

Add a reference from a legacy csproj targeting .NET Framework 4.5.2 -> .NET Core project, and you get the following warnings:

Warning     The project 'ConsoleApplication37' cannot be referenced. The referenced project is targeted to a different framework family (.NETCoreApp)   ConsoleApp1         
Warning     Project has no no target framework compatible with '.NETFramework,Version=v4.5.2'   ConsoleApp1         
Warning     The target "GetTargetPath" does not exist in the project.   ConsoleApp1 C:\Users\davkean\Documents\Visual Studio 15\Projects\ConsoleApplication37\ConsoleApplication37\ConsoleApplication37.csproj      
@srivatsn
Copy link
Contributor

srivatsn commented Dec 7, 2016

This is done.

@srivatsn srivatsn closed this as completed Dec 7, 2016
@StingyJack
Copy link

Does "This is done" mean the problem is fixed? Because its happening in the RTW for VS2017. Adding a HintPath for the project reference helps it sometimes.

@OlegKleyman
Copy link

yep same here. I'm just getting one warning though. "cannot be referenced. The referenced project is targeted to a different framework family (.NETCoreApp)" The library appears to be working though.

@StingyJack
Copy link

StingyJack commented Apr 9, 2017

@srivatsn - "Done" means "still not working" or "wont fix"?

I cant project reference a POCO library thats multi targeted from a framework app. I have to assembly reference its compiled location to make this work, but that's not going to work again once I change the solution configuration.

image

@srivatsn
Copy link
Contributor

srivatsn commented Apr 9, 2017

What frameworks does your library target? From the screenshot it sounds like atleast one of the targets is netcore which cannot be referenced by a framework app. You need to target netstandard to be able to reference the library from a framework project.

@gulbanana
Copy link

you could also target net itself rather than netstandard
either way though it should be fine to target both using something like
netcoreapp1.1;net461
in that case the old-style project should pick up the net461 build product and ignore the netcoreapp one, and if it doesn't it's a bug

@StingyJack
Copy link

I had it targeting netcoreapp1.1 (because it does that out-of-the-box). I changed it to this and had to restart VS a few times to get it to load properly. I still have to restart VS periodically when this gets "stuck" like the above image..

<PropertyGroup>
    <TargetFrameworks>netstandard1.6;net462</TargetFrameworks>
    <RuntimeIdentifiers>win10;ubuntu.16.04-x64</RuntimeIdentifiers>
    <RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
    <PackageTargetFallback>portable-net45+win8</PackageTargetFallback>
  </PropertyGroup>

@srivatsn
Copy link
Contributor

Needing to reload the project (I don't think you need a full VS reload) is a race condition in MSBuild\CPS that are tracking down. If you close and reopen the solution and if it still fails then it's a bug that we should investigate.

@srivatsn
Copy link
Contributor

Also as for the default TFM in VS there are two templates a .NET Core one and a .NET Standard one - see the discussion here for reasons - dotnet/project-system#1909

mmitche pushed a commit to mmitche/sdk that referenced this issue Jun 5, 2020
Installing only 1.1 cli for linux
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

7 participants