Error upgrading from .Net Core 1.0.0 to 1.1.0 - asp.net-core-mvc

I have a .NET Core project which I am getting back to which was working fine. I ran a NuGet update which upgraded a number of items, mainly going from AspNetCore 1.0.0 to 1.1.0. The solution compiles fine, but when I run it, I get this exception in the browser:
FileLoadException: Could not load file or assembly 'Microsoft.AspNetCore.Http.Features,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Adding Microsoft.AspNetCore.Http.Features in project.json does not fix the problem and I can find no reference to it. Does any one have a suggestion on resolving this?

I encountered the same problem after updating from 1.0.0 to 1.1.0 (ASP.NET Core Web Application (.NET Framework 4.6.2) x86) using Visual Studio Community 2017 RC.
My solution were to uninstall the Codegeneration design package:
Microsoft.VisualStudio.Web.Codegeneration.Design (1.0.0-msbuild1-final)
Update!
The faulty package has since been updated (1.0.0-msbuild2-final as of this writing). So instead of removing the package, tick "include prerelease" and update.

According to this site Announcing the Fastest ASP.NET Yet, ASP.NET Core 1.1 RTM the .NET Core 1.1 SDK needs to be installed. I assumed that I had already done that through a Visual Studio notification, but that wasn't the case. Once I installed it, the site worked.

Related

Cant deploy web app because of version conflict, however it runs fine locally

I have an ASP.net core web app which references a DLL called BLL, which in turn references a DLL called DAL, and within the DAL there is a reference to Microsoft.EntityFrameworkCore 7.0.2.
I have changed the .net versions of these 3 projects from 6 to 7 today, it all compiles and runs fine locally in Visual Studio.
However when I come to deploy it the BLL won't compile, I get an error:
Error CS1705 Assembly 'ST.CMS.DAL' with identity 'ST.CMS.DAL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.EntityFrameworkCore, Version=7.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' which has a higher version than referenced assembly 'Microsoft.EntityFrameworkCore' with identity 'Microsoft.EntityFrameworkCore, Version=6.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' ST.CMS.BLL C:\Users******\ST.CMS\ST.CMS.BLL\CSC 1 Active
So there is a conflict between 6.0.2 and 7.0.2 for EntityFrameworkCore, however i'm not using 6.0.2 anywhere, I can't understand where it's getting 6.0.2 from.
Before I did this change today it deployed fine. I have tried closing and reopening Visual Studio and rebooting the laptop but it still keeps happening.
Simply removing the Nuget package references to Entity framework core in the DAL project then re-adding them solved the problem.

In Visual Studio 2019, .net Core 2.1, how do I add .net Framework assembly to the project

I am working in Visual Studio 2019, and .net Core 2.1.1.
I am currently working on trying to get Identity Server 4's WsFederation integrated. In the latest instructions I could find, he mentions adding System.IdentityModel to the app through the project.json. Project.json seems to be deprecated now in .net core projects, and I am having a hell of a time figuring out how to add a freaking .net assembly to my project. Do I really need to just copy the file into the project and reference, cause that just seems wrong.
Instructions I am using:
https://www.scottbrady91.com/Identity-Server/IdentityServer-4-SharePoint-Integration-using-WS-Federation
Seems to all come back to the project type. I had created the project with AspnetCore and so I couldn't reference any .net framework assemblies, because you can't go back once you have made that choice. However, if you create the project specifically under the .net framework, you can move forward into the core frameworks, and hosting libraries of core. Which then allowed me to pull in the System.IdentityModel assemblies I needed to continue forward.

Supporting an .Net Framework Lib in .Net Core 2.0 WebAPI - Error

so basicly out complete company dataaccess is based in .Net Framework 4.6.
We are only on windows, so no problems here atm.
We have a new project in which I want to use .Net Core 2.0 and WebAPI but I have to use this "old" .net Framework lib.
When I add the reference and start my project I will get an error:
Could not load type 'System.Security.Principal.WindowsImpersonationContext' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.'
As far as I googled it and understand, the dataasccess lib will try to get the win auth but this isnt available in .net core (obvious) any more.
I found the nuget Microsoft.Windows.Compatilibity and after installing the error is gone.
But another one comes up:
Exactly this error:https://community.oracle.com/thread/4139377
And the only solution to this seems to be to remove the MS.Win.Comp package...
So a bit of a circle.
Any ideas?

Upgrade from MVC3 rc2 to RTM

The release notes cover the MVC2 -> MVC3 path. What about RC2 -> RTM? I installed the RTM via Web Platform Installer but looking to the path that System.Web.Mvc reference in my existing project (C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll) has a date stamp of 1/4/11 so that can't be right.
If i use WPI to install RTM, shouldn't i expect it to have upgraded the RC? Are special steps required in instances where the RC had been installed?
thx
You don't need to do anything to upgrade. The RC2 projects are compatible with RTM. And the file date on disk is probably just the date that you installed Mvc, not he version of the mvc dll
Not sure if there is a question in there.
If you installed a newer version of MVC3 on your machine, you'll need to add a new reference to it in your project. Otherwise, your project will stay on the version of the assembly it currently references to avoid breaking changes.
If you find yourself with a lot of problems keeping your assemblies in an up to date reference, check out Microsoft's NuGet project.

system.diagnostics.contracts.contract exists in both v4.0 v3.5

I just upgraded to visual studio 2010 and installed the code contracts msi. When I try to use it I get a compiler error that the system.diagnostics.contracts.contract dll exists in both the v3.5 and v4 framework. Anyone know what I should do to resolve this? Thanks.
If you're upgrading a .NET 3.5 project that uses contracts to .NET 4.0, make sure you remove your reference to the Microsoft.Contracts assembly.
The Microsoft.Contracts assembly provides code contracts for use in .NET 2.0 or 3.5 projects, but is provided by default with .NET 4.0 in mscorlib, so you don't need it. They both share the System.Diagnostics.Contracts namespace, so by having references to both at the same time, the compiler isn't able to figure out which one you're trying to use.
I solved it by first installing it, thou that did not actually solve it.
Then removed the references and then I changed the project versions to 4.5 and after that, it worked.

Resources