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

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.

Related

.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.

How to change .Net Core 2.1 project to .Net Core 2.0 project

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

How to fix the error - The target "_CopyBinDeployableAssemblies" does not exist in the project?

I am trying to build a project that was created with MVC 4.0. There were errors with 'AllowAnonymous' attribute, because the build server did not have MVC 4.0 installed. So, I started installing MVC 4.0, but the setup prompted me to install Visual Studio 10.0 SP1 first, so I installed VS 10.0 SP1 and then installed MVC 4.0. The errors related to 'AllowAnonymous' attribute went away after the next build. But now I am getting an error which says - The target "_CopyBinDeployableAssemblies" does not exist in the project.I have tried a couple of solutions found on stack overflow that suggested
Importing the project Microsoft.Application.Web.Targets and Microsoft.Web.Publishing.Targets.
Install/Repair using the exe at http://go.microsoft.com/fwlink/?LinkId=253458.
But nothing has worked so far.
Please help me.
I managed to resolve this error by adding an empty targets tag in the .csproj file for the project:
<Target Name="_CopyBinDeployableAssemblies"></Target>
Found this on stackoverflow itelf in the response to a similar question:
Why do I get the error "The target GatherAllFilesToPublish does not exist"?

The root assembly conflicts with another assembly

Previously I was using Xamarin Studio to build the App and it was working perfectly fine. Now I copied the same solution and try to build on Visual Studio through Xamarin Mac Agent. whenever I try to run the App, I am getting following error:
The root assembly
/Users/eagle/Library/Caches/Xamarin/mtbs/builds/App1.iOS/3592b16d5f6494c29443153f9249eb47/bin/iPhone/Debug/App1.exe
conflicts with another assembly
(/Users/eagle/Library/Caches/Xamarin/mtbs/builds/App1.iOS/3592b16d5f6494c29443153f9249eb47/bin/iPhone/Debug/App1.exe).
Upgrade the VS to current stable channel version, refer to here
Try to rename Application Name in your project in visual studio,since both two assembly would be referred to same place.

Visual Studio 2010 Web deployment project file error

I am trying to build a web development project in VS2010, but although all the individual projects build the web deployment project returns the following error.
C:\Program Files (x86)\MSBuild\Microsoft\WebDeployment\v10.0\Microsoft.WebDeployment.targets(1520,9): error MSB3462: Either MetabasePath or VirtualPath must be specified.
The .Net framework for the main web project is set as .Net 3.5.
Has anyone seen this error before as googling it returns very little.
EDIT: this project was upgraded from VS2008

Resources