.Net target framework changed to 4.7.2 - asp.net

I am facing below issue after updating .net target framework version to 4.7.2
Could not load file or assembly 'System.Net.Http, Version=4.2.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its
dependencies. The system cannot find the file specified.

Related

Assembly uses 'System.Runtime' Version=4.2.2.0 which has a higher version than referenced assembly 'System.Runtime' Version=4.1.2.0

I have a .NET Framework 4.7.2 project that reference a .NET Core 3.1 library. The problem is that I get this error:
Error CS1705 Assembly 'X' with identity 'X, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
In NuGet Manager for both projects, I have tried to add System.Runtime 4.3.1. Still I get the same error. How can this be fixed?

Could not load System.Web.Extension when add reference to net 4.x from net core 3.1

I have a project in net core 3.1 and I add reference that written in net 4.x. When I call method of referenced dll which calling http request error occured that could not load file or assembly 'system.web.extensions, version=4.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35'. the system cannot find the file specified.' How can I solve it?

Unable to run the application using VS2017

I have a .Net application which has target framework of 3.5
While debugging the code , i am facing the below error.
The primary reference "xxx" could not be resolved because it has an
indirect dependency on the .NET Framework assembly "mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
which has a higher version "4.0.0.0" than the version "2.0.0.0" in the
current target framework.
I am running the application on VS2017.
How to rectify the error.

Building Core2.0 project in Visual Studio Team Services fails with numerous assembly import errors

I have Build Definition
.NET Core Restore
.Net Core Build
.Net Core Test
.Net Core Publish
Publish Artefact
While I was using Core1.1 it worked without any issue. But after upgrading project to Core2.0 it fails with multiple errors like
error CS1703: Multiple assemblies with equivalent identity have been imported: 'C:\Users\buildguest\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Threading.Tasks.Parallel.dll' and 'C:\Users\buildguest\.nuget\packages\system.threading.tasks.parallel\4.3.0\ref\netstandard1.1\System.Threading.Tasks.Parallel.dll'
error CS0433: The type 'TargetFrameworkAttribute' exists in both 'System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
error CS0518: Predefined type 'System.String' is not defined or imported
Solution is perfectly building locally. I tried to add task Use .NET Core runtime 2.0.0 in the beginning but without any success.
You should add .NET Core Tool Installer task at the beginning of the build steps. Then install the SDK not only runtime. Then save your build definition and queue again.

ASP .NET Web Forms: Could not load file or assembly 'System.Web.WebPages.Deployment, Version=2.0.0.0

I moved my existing ASP .NET web sites and web applications to a new server, and I'm getting the following error:
Could not load file or assembly 'System.Web.WebPages.Deployment,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The system cannot find the file specified.
I located this assembly on my computer, and copied it to the BIN folder of my web site. It gives a new error:
Could not load file or assembly 'System.Web.WebPages.Deployment,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The located assembly's manifest definition
does not match the assembly reference. (Exception from HRESULT:
0x80131040)
Does this mean ASP .NET is not properly installed on the server machine? How do I go about fixing this? I also noticed that the assembly is present on my computer somewhere in the Program Files (x86)/Microsoft ASP.NET folder. However, the Program Files (x86)/Microsoft ASP.NET folder does not exist on the server.
Solution: I installed both ASP .NET Web Pages and ASP.NET MVC 4 on the server. This installed the missing assemblies and created the folders that were missing.
The exceptions speak for themselves: Your project has referenced version 2.0.0.0 of this assembly and you have copied version 1.0.0.0
Find the correct version and you'll be OK

Resources