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

Update 16.7 error message when targeting 5.0 #5820

Closed
marcpopMSFT opened this issue Oct 21, 2020 · 11 comments
Closed

Update 16.7 error message when targeting 5.0 #5820

marcpopMSFT opened this issue Oct 21, 2020 · 11 comments
Assignees
Milestone

Comments

@marcpopMSFT
Copy link
Member

marcpopMSFT commented Oct 21, 2020

Issue
If a customer created a net 5 app or got one from a coworker, opens it in 16.7, we have a bad error experience today as we decide it must be a framework application.
dotnet/core#5311

We don’t recognize the TFM so we assume it’s a .net framework version and the message matches that.

Proposal
Update MSBuild 16.7 with a new message in this specific scenario in the below code path.

@rainersigwald, any concerns just adding a check here for if the version is >= to 5.0 and providing a different error? That seems like the narrowest way to solve this with the least risk. I wouldn’t bother with 16.4.

Log.LogErrorWithCodeFromResources("GetReferenceAssemblyPaths.NoReferenceAssemblyDirectoryFound", frameworkmoniker.ToString());

Other questions

  • How does 16.7 MSBuild parse TFMs with a platform provided (ie net5.0-windows) and will the value for version above be accurate?
  • Check precompiled apps
@marcpopMSFT marcpopMSFT added bug needs-triage Have yet to determine what bucket this goes in. labels Oct 21, 2020
@marcpopMSFT marcpopMSFT added this to the MSBuild 16.7 milestone Oct 21, 2020
@marcpopMSFT marcpopMSFT removed the needs-triage Have yet to determine what bucket this goes in. label Oct 21, 2020
@marcpopMSFT
Copy link
Member Author

@benvillalobos mind prepping a 16.7 fix for this? No rush as we have a week or so before they lock down. Talk to Kathleen about the specific message to show and talk to Rainer about the app types he's concerned about. Test 5.0-windows.

@benvillalobos
Copy link
Member

Sure. What is the expected value of frameworkmoniker.Identifier when we're on net5.0? Is it net or netcoreapp?

@benvillalobos
Copy link
Member

Created PR for the rest of the discussion here: #5826

@benvillalobos
Copy link
Member

@marcpopMSFT Targeting net5.0-windows results in an SDK error:

"C:\src\repros\5820-16.7-errormsg\5820-16.7-errormsg.csproj" (default target) (1) ->
(_CheckForUnsupportedTargetFramework target) ->
  C:\Program Files\dotnet\sdk\3.1.403\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(93
,5): error NETSDK1013: The TargetFramework value 'net5.0-windows' was not recognized. It may be misspelled. If not, th
en the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. [C:\src\repros
\5820-16.7-errormsg\5820-16.7-errormsg.csproj]

@marcpopMSFT
Copy link
Member Author

That seems like a reasonable message. I don't think we want to try to special case every possible targetframework that we don't recognize. @KathleenDollard as an FYI.

@Forgind
Copy link
Member

Forgind commented Oct 29, 2020

Any reason this is still open?

@benvillalobos
Copy link
Member

@Forgind I'll keep this open until we also merge into 16.8

@marcpopMSFT
Copy link
Member Author

May want to test if this makes sense in 16.8 as it may not apply after 16.7.

@mc0re
Copy link

mc0re commented Mar 24, 2021

Still gives an error on msbuild version 16.8.2+25e4d540b. Is there any workaround?

@benvillalobos
Copy link
Member

@mc0re do you have a global.json file that's lowering the sdk you use while targeting your app to net5.0?

@mc0re
Copy link

mc0re commented Mar 24, 2021

The error gone away after updating to 16.9.2. Now I have other problems, but they are more click-once related :-)

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

5 participants