How to change .Net Core 2.1 project to .Net Core 2.0 project - visual-studio

Having trouble converting my .Net Core 2.1 project to .Net Core 2.0. I changed the target build type in my project solution properties as well as target framework in my .csproj file. Visual Studio will not let me build this application because the project is still inherently .Net Core 2.1.

I've had a similar issue recently. Cleared my packages folder and vs cache. Restarted vs, and everthing did build fine.

I changed the target framework in my .csproj file and what did the trick for me was reinstalling older NuGet packages.

Got the same issue
Deleting the content of the "bin" folder did the trick

Related

Visual Studio for Mac trying to find .NET Full Framework in build properties

Visual Studio for Mac (Version 8.8.7 (build 18)) is unable to upgrade netcoreapp3.1 asp.net mvc project to .net5.0 target framework. It throws below error:
/usr/local/share/dotnet/sdk/3.1.405/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(5,5):
Error NETSDK1005: Assets file 'App.Mvc/project.assets.json' doesn't
have a target for '.NETFramework,Version=v5.0'. Ensure that restore
has run and that you have included 'net50' in the TargetFrameworks for
your project. (NETSDK1005) (App.Mvc)
It will create a net5.0 mvc project from scratch alright but upgrade fails with the error. I've also tried to move all the files over into a new net5.0 from my netcoreapp3.1 project and somehow it converts the new project to .net full framework again. There's no clear indication as to what's causing this issue.
Ok I figured it out. I had a global.json pointing to version 3.1.*. Had 5.0.102 and it worked.

.NET Core Web API 5.0 build errors

Severity Code Description Project File Line Suppression State
Error NETSDK1005 Assets file 'D:\Working On\Gra\Gra\obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v5.0'. Ensure that restore has run and that you have included 'netcoreapp5.0' in the TargetFrameworks for your project. Gra C:\Program Files\dotnet\sdk\5.0.100-preview.1.20155.7\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 234
I've just create ASP.NET Core Web Application, and then when I run, I it's show message errors!
In my publish profile the Target Framework was set to NET5.0.
Changed it to NET6.0 and the problem was gone.
Update to Nuget 5.8
Clear the local cache
error NETSDK1005: Assets file 'project.assets.json' ....
Try updating NuGet.exe to the 5.8.0 version or above:
nuget update -self
if you prefer to update the nuget version in Visual Studio, just follow this steps. Then, clear NuGet cache:
dotnet nuget locals all --clear
Download Nuget
found here
Delete the 'obj' folder and re-build the project.
You're using an extremely old .NET 5 preview. ASP.NET Core Preview 1 specifically had no new features, it was essentially a version number change. There's no netcoreapp5.0 framework target any more, it's net5.0.
The latest version is 5.0 RC1 which is feature-complete and supported in production. Install it and create a new project with, eg dotnet new webapp or dotnet new webapi etc.
This version is supported by the latest Visual Studio 2019 Preview version.

an added reference doesn't appear in the list of my .net project references

I have a web application developed under Visual Studio 2005. I have a dll (home made) that I need to add as a reference to my project. I do "Add reference", the dll is added to the Bin folder but It's not added to the list of the references ! So the project doesn't compile. Could you please tell why the dll is added to the Bin folder but it's not added to the list of references of the project? Many thanks !
Walloud
If your "home created" assembly targets a framework newer than .NET 2.0, you won't be able to add a reference to it in a .NET 2.0 project in Visual Studio 2005.
Make sure your project for the DLL you created targets .NET 2.0, and not a newer framework, such as 3.5 or 4.0.
Since VS 2005 didn't know about the newer frameworks, you don't get proper error messages about this (from what I recall, though I no longer have a copy to test), which is likely why you're confused.
The problem is resolved. I was working on an XP virtual machine and it appears that there is some issue with it. When I used a real XP machine it worked !

Class library set to .NET 2.0 is building to .NET 4.0

I have a web solution that contains 5 class libraries and one asp.net web site project. It's an e-commerce solution that is compiled for .NET 3.5 (some class libraries are set to .NET 2).
When I got VS 2010 installed I decided to give a try and upgrading it to .NET 4 but that didn't go so well, can't remember why. I reverted the source code control, cleared all local files, re-downloaded from source control and went back to VS 2008.
I decided to give it another try with VS 2010 due to some issues with VS 2008 but when I build the solution it fails because one of the class libraries is compiling to .NET 4. I checked the project settings and it is set to .NET 2. I have tried doing a clean on the solution, that makes no difference, the project always builds the assembly to .net framework 4.x.
I imagine something is getting cached on the system, i.e. msbuild, etc. Does anyone know where to clear this cache so that whatever is holding my class library hostage to .net 4 can actually let it completely recompile and pick up the project settings again?
Thank you.
This was a problem in the project file having the Tools attribute set which just needed to be cleared for .NET 4 compilation.

What is the impact of upgrading MSBuild to VS2010 for projects targeting .NET Framework 2.0 and 3.5?

I’m working on the build process for a VS 2010 solution and some projects within it target the .NET framework 4.0. As far as I know, to have this type of solution built by TFS 2008 we will have to change the version of the MSBuild.exe file used by the build agent – modifying the TFSBuildService.exe.config file, pointing MSBuildPath entry accordingly.
Do you know if this will have any impact to existing project builds that target the 2.0 and 3.5 framework? Are you aware of any known issues with this type of set up?
We made such upgrade from VS2008 to VS2010 without the TFS migration (so it's still in 2008 version). Only problem we had was with build machine (cause we have only one) so we had to configure SideBySide builds. We had projects in VS2008 solution with MSBUILD scripts, some of them were migrated to VS2010.
Here's the solution http://www.codeproject.com/KB/architecture/SideBySideTfsBuild.aspx
After changing we didn't experience any problems, yet:)

Resources