Problem: The .NET Core frameworks can be found at:
- https://aka.ms/dotnet-download /root/.nuget/packages/microsoft.aspnetcore.razor.design/2.2.0/build/netstandard2.0/Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets(79,5): error : rzc discover exited with code 150.
Problem: ERROR: Service 'service_name' failed to build: The command '/bin/sh -c dotnet publish -c Release -o out' returned a non-zero code: 1
[Notes]: If you have worked with docker-composer.yml file to build an Asp.Net Core 3.0 application into a Docker Container, you might have seen the error that says "rzc discover exited with code 150"
- This error is because of the razor engine included in project.csproj file
<PropertyGroup> <TargetFramework>netcoreapp2.2</TargetFramework> <PropertyGroup>
- If you build your docker image using a different Dot Net version and your asp.net core application references another version in .csproj this becomes an issue.
Solution: Downgrade the Asp.Net Core version in the Dockerfile file in your project. E.g. if you were using an asp.net core image version 3.0 you must downgrade to asp.net core version 2.2 and build your docker image again. This error might have been resolved in the latest build.