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

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.

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

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

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.

Clean your hosted folder and install fresh. Re-installing the SDK/runtimes did not fully correct the issue for me.
Resolved this error by:
Re/Install SDK on IIS Server (2.1.3xx)
Re/Install SDK on Dev Machine (2.1.3xx)
Re/Install Runtime on IIS Server (2.1.2)
Clean hosted folder on IIS Server (I had old cshtml/dlls)
Republish to clean folder
Also try with an empty new project (File -> New Project -> ASP.NET Core Web Site -> 2.1)

Related

NuGet Server for .NET Core

The NuGet.Server package is used to create a ASP.NET MVC NuGet server and it works just fine. There is another package NuGet.Server.Core that is expected to do the same when hosted within a ASP.NET Core (perhaps 1.0 or 1.1?).
The first one creates 'Packages' folder right beneath the main folder used as a package repository.
No such things happens after installing the Core version. I tried both root and a dedicated folder. Googling a bit, I found no info about installing the package and integrating it in a ASP.NET Core app.
Has anyone succeeded in installing the Core version? Also, there's another version NuGet.Server.V2 which depends on NuGet.Server.Core, however it requires .NET Framework 4.6.1. This makes me think that NuGet.Server.Core is not targetting .NET Core at all.
If so, the name must be somewhat misleading, I guess...
Yes, this is the answer:
No .NET Core whatsoever! Just .NET Framework 4.6.1. Not a big discovery but a warning to all devs who, like me, were (and, more importantly, will be!) misled by 'Core' in the package's name.
Here's a 3rd party option (free)
https://github.com/loic-sharma/BaGet
Nuget.Server.Core seems to be one of the dependencies of Nuget.Server. So it's not a .NET Core project. Guess that's one of those snags you run into when you call your framework "Core". :)
I think you can use BaGet.
There is my article about that.
Check this :
Create your own NuGet server and package feed

Error while Publishing Web App in Visual Studio Professional 2013

I am trying to publish my Web App in Visual Studio Professional 2013 but getting the following error
I got the same question asked over here but no useful answer.
Can anyone please help
You probably will be using older version, that was having an issue. refer detail [here]
Install the newer web deployment tool, should work.
which .net version are you using.
check web deploy version. if vs has 2 web deploy version, the vs get confuse to take which version. If it has 2 version, just uninstall vs and then instal it along with web deploy. if the Vs has one 1 web deploy version, you uninstall and install the web deploy. It will rectify your problem i hope.
You can refer This link
Check if version 9.0.0.0 of the assembly is installed in GAC. (from the VS2013 developer command prompt) gacutil /l Microsoft.Web.Deployment. Issues like this have occurred in the past where things worked, then after installing an update (or trying to install one) then reports of missing dlls, like nuget, occur.
The usual course of action is to repair the Visual Studio installation.
There is a problem with your publish profile. Delete the pubxml file located bellow Properties folder in your project and then create a new publish profile.
I got the same problem when older project runs into the new .NET Framework, for that you have to do the following.
Right Click on your project name->select Property Pages -> Click Build from the menu-> then select Target Framework .Net framework 4.5 or your current using framework..
"Could not load file or assembly" means the required file (of that mentioned version) is not available in the assembly (nor in the registry). All you gotta to do is to ensure this same is installed properly that would allow you to proceed further. The other things to ensure is the latest framework installed on your system.
Think you have some errors happen when to install or update Visual 2013, so you can reinstall again and this error will be fixed.

What the point of the dnx-mono package in NuGet?

When developing an ASP.NET 5 app, I can install the mono runtime into it via NuGet. For example, the latest to date dnx-mono.1.0.0.rc1-update1.
As far as I've tested, the thing is the actual runtime I'm installing on, for example, Linux via DNVM tool to run ASP.NET apps on it.
If I installed the package into a project, I can't then chose it in project properties, nor I can chose it when publishing into a folder - only Windows clr versions are available.
So what's the point of installing it right into the application project?
Or maybe it is not intended to be installed into a project, but exists solely for DNVM could find and pick it up?
You're right. It is used by DNVM and your application should never reference it directly.

ASP.NET web app not deploying correctly on Windows server 2012

So here's the thing. I recently updated a web project to use nuget for its dependencies, which in turn updated all of those dependencies to the latest versions.
Quite a task as there were some breaking changes, but I have the thing running locally perfectly.
We use TeamCity to pull the solution from bitbucket and deploy it the the local iis folder on a development (staging) server.
After a build, the website seems very poorly, first off it complains:
Could not load file or assembly
'file:///C:\web\Dev.Pegfect.Presentation\bin\mscorlib.dll' or one of
its dependencies. An attempt was made to load a program with an
incorrect format.
Which is strange since my local copy does not have a copy of mscorlib in its web bin folder. Should be using the GAC? If I remove the dll, I get a new error (some NHibernate issue complaining about reflection). I haven't pursued that since it all seems environmental.
If I copy my local bin folder over the server web bin, it starts to run ok albeit extremely slowly (relative to how it used to).
So, the question "what have you tried" - i am currently installing VS 2012 onto the server and will try building the project from source directly. I am also considering updating TeamCity from v7 to v9.
I could also try to reinstall IIS8.0 on the server.
These are desperate, blind shots in the dark. What would you try?
FWIW the project is targeting .NET 4.5.1 (ANY CPU)
OK, so I will leave it here as it might help someone.
So, the project has been building, deploying and running successfully on the server compiled to .NET 4.5.1 with no problem.
The recent packages update moved us from MVC v4 to MVC v5. (amongst other things). Running .NET fix tool suggested 4.5.1 was corrupted, so I downloaded the developer version and installed and now its fine.

Could not load file or assembly WebGrease,dll Version Clash

This problems is nagging me from last night ,I can't figure out its solution.
Well let me explain the structure of my project,In a single solution file I have three projects two are asp.net mvc 4 projects and one in C# Library,the problem started when I added new asp.net mvc 4 project.
I have tried several solutions ,but they didn't worked for me,
nuget restore (first I deleted the whole package folder then applied
nuget restore).
Tried uninstalling asp.net web optimization package then
webgrease and then installed them both.
Tried cleaning temp folder of asp.net.
Removed xmlns from web.config assemblyBinding tag
Note:
By using the first solution I was able to fix the problem on my home dev machine,but the same solution doesn't works on my office dev machine :(
I have also discussed this problem on asp.net chat before posting question here.
Assembly binding log aka FusionLog Viewer
tried several SO solutions.
Update:
Moved the two MVC4 webapp in seperate solutions,so one solution is
working fine but another is having same webgrease problem.
Solution:
Check my answer below for the solution which worked in my situation.
If your solution it's for 64-bit and the dll-s are for 32 bit, go to:
IIS / Application Pools
Right click your website app pool / advanced settings
Set 'Enable 32-bit Applications' to TRUE
Hi guys,
So I merged my both solutions,now both mvc4 projects along with a test case project and C# Class library project are in the same solution.
I finally made it work for me,here are the steps with the nuget console commands
uninstall-Package Microsoft.AspNet.Web.Optimization
uninstall-Package webgrease
Install-Package Microsoft.AspNet.Web.Optimization -Version 1.1.0
Note:
I was having WebGrease 1.5.2 and Microsoft.AspNet.Web.Optimization 1.1.3 in my project and I had to rollback to earlier version to make it work.

Resources