question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Microsoft.NETCore.App type: platform can be restored but not built for netcore50 projects

See original GitHub issue

Steps 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.

/cc @Eilon @pranavkm @pakrym

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

0reactions
weshaggardcommented, Jun 21, 2016

Yes this has been fixed.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found