I recently upgraded my Visual Studio 2017 Community Edition from version 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 Publishing Profile.
The error messages is 'C:\Program Files\dotnet\sdk\2.1.102\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(167,5): Error : Assets file '\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.0'. Ensure that restore has run and that you have included 'netcoreapp2.0' in the TargetFrameworks for your project.'
I have tried:
- Re-downloaded new Package Profiles and then rebuilding and publishing.
- Deleting the project.assets.json file from \obj\ folder, rebuilding the publishing.
- Changing the Target Framework in Project Properties from .NET Core 2.0 to another framework and back again, rebuilding and publishing.
None of the above resulted in a successful deployment and I kept getting the same error message.
I also examined the project.assets.json file and the target is ".NETCoreApp,Version=v2.0".
I ran 'dotnet restore', 'dotnet build' and 'dotnet deploy', all of which succeeded.