Cannot find compilation library location for package 'Microsoft.NETCore.App'

I've upgraded from .NET Core 2.0 to 2.1.1 (so many elements that gets highly confusing).

I built my project and now I'm getting this error:

Cannot find compilation library location for package 'Microsoft.NETCore.App'

I don't know what other information should I provide. Please guide me in providing more info on this issue.

It's such a frustrating experience. Upgrading backward compatible version in Semantic Versioning shouldn't break things. I wish they had versioned this release as .NET Core 3.0, so that we wouldn't upgrade. Any help?

Update: I created this issue on GitHub.

Upvotes: 5

Views: 5411

Answers (4)

Muni Chittem
Muni Chittem

Reputation: 1136

I did simple fix for this issue, I selected option to remove additional files at destination before publish and then it solved my issue.

enter image description here

Upvotes: 3

Robert J. Good
Robert J. Good

Reputation: 1357

Clean your hosted folder and install fresh. Re-installing the SDK/runtimes did not fully correct the issue for me.

Resolved this error by:

  1. Re/Install SDK on IIS Server (2.1.3xx)
  2. Re/Install SDK on Dev Machine (2.1.3xx)
  3. Re/Install Runtime on IIS Server (2.1.2)
  4. Clean hosted folder on IIS Server (I had old cshtml/dlls)
  5. Republish to clean folder

Also try with an empty new project (File -> New Project -> ASP.NET Core Web Site -> 2.1)

Upvotes: 0

Alex
Alex

Reputation: 1046

Just set MvcRazorExcludeRefAssembliesFromPublish to false in your .csproj file and that should fix the issue.

Upvotes: 2

Chris Pratt
Chris Pratt

Reputation: 239300

You're missing the SDK. Download and install 2.1.301 (at the time of writing), and you'll be okay. FWIW, you're not forced to upgrade. If the packages upgraded automatically, you either set a wildcard on package version or you just did something like "Upgrade all" in the NuGet Package Manager GUI. If you're concerned about things upgrading without your permission, then use explicit version numbers and pick and choose each package to upgrade manually.

Upvotes: 0

Related Questions