Microsoft.NETCore.App type: platform can be restored but not built for netcore50 projects
See original GitHub issueSteps to reproduce
- Create a project with the
project.json
:
{
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-*"
}
},
"frameworks": {
"netcore50": {
}
}
}
- Add a class
public class Anything
{
}
- Run dotnet restore (completes successfully, but shouldn’t).
- Run dotnet build
Expected behavior
Restore should have failed with
Package System.Runtime.Loader 4.0.0-rc2-24027 is not compatible with netcore50 (.NETCore,Version=v5.0). Package System.Runtime.Loader 4.0.0-rc2-24027 supports:
- net462 (.NETFramework,Version=v4.6.2)
- netstandard1.5 (.NETStandard,Version=v1.5)
One or more packages are incompatible with .NETCore,Version=v5.0.
Actual behavior
Restore succeeds and build fails with:
error NU1002: The dependency System.Runtime.Loader 4.0.0-rc2-24027 does not support framework .NETCore,Version=v5.0.
Environment data
.NET Command Line Tools (1.0.0-rc2-002678)
Product Information:
Version: 1.0.0-rc2-002678
Commit Sha: 3b2ea9d14b
Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64
Extra
If you remove "type": "platform"
from Microsoft.NETCore.App
restore fails as expected.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
The project was restored using Microsoft.NETCore.App ...
Found out solution: Uninstall .NET Core SDK 2.1.401, that came with vs2017 v15.8.2 and install it again using an installer from the ....
Read more >Started to get "This project is targeting a version of .NET ...
I'm getting this same issue with ASP.Net Core 3.1. The solution has been fine for two years and now it want's to install...
Read more >NETSDK1079: The Microsoft.AspNetCore.All package is ...
You may receive this error message when: You retarget an ASP.NET Core project from .NET Core 2.2 or earlier to .NET Core 3.0...
Read more >dotnet build command - .NET CLI
The dotnet build command builds a project and all of its dependencies.
Read more >Troubleshoot .NET Framework targeting errors
To resolve the error, make sure that your application targets a .NET version that's compatible with the version that's targeted by the projects...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I believe @weshaggard fixed this as of https://github.com/dotnet/core-setup/commit/42b00aa3b269f598853d1e3cdfbf20e66429d7d1
Yes this has been fixed.