Solved: docker-compose build core 3.0 error rzc discover exited with code 150

Problem: The .NET Core frameworks can be found at:


/root/.nuget/packages/,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 razor engine included in project.csproj file 


- If you build your docker image using a different Dot Net version and your core application references another version in .csproj this becomes an issue.

Please Login to see the rest of the answer

Answer: Downgrade the Asp.Net Core version in Dockerfile file in your project. E.g. if you were using an core image version 3.0 you must downgrade to core version 2.2 and build your docker image again.

Write an Article
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.

Linda said:

Thank you.

© 2022 - ErnesTech - Privacy