Error publishing .NET Core 2.0 web application in Azure App Service

I recently upgraded from Visual Studio 2017 Community Edition from 15.6.2 to 15.6.3, and since then I have not been able to successfully deploy my .NET Core 2.0 web application to my Azure App Services using an existing publish profile.

Error messages: "C: \ Program Files \ dotnet \ sdk \ 2.1.102 \ Sdks \ Microsoft.NET.Sdk \ build \ Microsoft.PackageDependencyResolution.targets (167.5): Error: asset file '\ project.assets. json 'has no purpose for' .NET NET Corepp, Version = v2.0 '. Make sure the restore is complete and that you have included "netcoreapp2.0" in TargetFrameworks for your project.

I tried:

  • Re-downloaded the new package profiles, and then restored and published.
  • Delete the project.assets.json file from the \ obj \ folder, restore the publication.
  • Change the target structure in the project properties from .NET Core 2.0 to another environment and vice versa, restore and publish.

None of the above led to a successful deployment, and I continued to receive the same error message.

I also examined the project.assets.json file, and the goal is ".NETCoreApp, Version = v2.0."

I started the recovery of "dotnet", "dotnet build" and "dotnet deploy", all of which succeeded.

Has anyone had this problem and solved it successfully?

+5
source share
3 answers

I had the same issue with publishing and local build.

The development community discusses this https://developercommunity.visualstudio.com/content/problem/218674/assets-file-cxxxxxxobjprojectassetsjson-doesnt-hav.html

Resharper and MS people found the problem and promised to fix it soon ...

At the moment, removing sdk \ 2.1.102 and restarting solves my problems

+2
source

The problem is fixed in ReSharper 2017.3.5, everything works with all combinations of Visual Studio and .NET Core SDK. You can find additional technical details in the official blog post: https://blog.jetbrains.com/dotnet/2018/03/23/build-failures-visual-studio-15-6-3-resharper-ultimate-2017- 3-5-rescue /

+2
source

I fixed the problem by deleting the sdk \ 2.1.102 folder, as suggested by @NikolaiT and @Jerry Liu.

I also found that the problem was fixed by updating to Visual Studio 2017 version 15.6.4 when the new sdk was installed. The new version of sdk was 2.1.103.

+1
source

Source: https://habr.com/ru/post/1275982/


All Articles