Fixing the error "rzc rewritecss exited with code -2147450730."

While working on an existing .NET Core project I ran into a number of SSL issues (where suddenly certain ports on my localhost would no longer serve up a site with a valid SSL certificate). In order to rule out an issue with my existing project, I created a new .NET Core 6.0 web application. However, that failed to compile and presented me with this error message:

rzc rewritecss exited with code -2147450730.

I searched Google and found a few references to this error but they all seemed to deal with .NET Core 3.x and none of the answers worked for me.

After trying various options such as rebooting, disabling extensions, cleaning and rebuilding the solution and installing additional NuGet packages, I ran dotnet build at the command prompt to see if that would give me anything. And it did!

Here's the full text of the error:

It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '6.0.2' (x64) was not found. - The following frameworks were found:
1.0.13 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
1.1.10 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
2.0.9 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
2.1.7 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
2.1.24 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
2.1.27 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
2.1.28 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
2.1.30 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
3.1.11 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
3.1.18 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
3.1.20 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
3.1.21 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
3.1.22 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
5.0.2 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
5.0.4 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
5.0.9 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
5.0.10 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
5.0.11 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
5.0.12 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
5.0.13 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
5.0.14 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]
6.0.0-preview.5.21301.5 at [C:\program files\dotnet\ shared\Microsoft.NETCore.App] 6.0.1 at [C:\program files\dotnet\shared\Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK. The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=6.0.2&arch=x64&rid=win10-x64

Plenty of .NET Core versions to choose from but not the one it was trying to find!

Why .NET suddenly decided to target .NET Core 6.0.2 I am not entirely sure. It looks like a faulty or incomplete update of Visual Studio 2022. I run both the official release and the preview channel side by side and this morning I updated the official version to 17.1.0. It looks like it updated the default target framework to 6.0.2 without completing the actual install of the SDK.

After installing the .NET 6.0.2. SDK from https://dotnet.microsoft.com/en-us/download/dotnet/6.0, running dotnet build then gave me this:

Wonderful! That made the compile errors go away in the command prompt as well as in Visual Studio. Despite the message about installing a missing localhost certificate, my original problem wasn't gone. However, with the script from this SO post: https://stackoverflow.com/questions/64880715/https-error-in-asp-net-core-app-running-on-iisexpress-pr-connect-reset-error that problem went away too.


Where to Next?

Wonder where to go next? You can read existing comments below or you can post a comment yourself on this article.

Doc ID 635
Full URL https://imar.spaanjaars.com/635/fixing-the-error-rzc-rewritecss-exited-with-code-2147450730
Short cut https://imar.spaanjaars.com/635/
Written by Imar Spaanjaars
Date Posted 02/16/2022 13:01

Talk Back! Comment on Imar.Spaanjaars.Com

I am interested in what you have to say about this article. Feel free to post any comments, remarks or questions you may have about this article. The Talk Back feature is not meant for technical questions that are not directly related to this article. So, a post like "Hey, can you tell me how I can upload files to a MySQL database in PHP?" is likely to be removed. Also spam and unrealistic job offers will be deleted immediately.

When you post a comment, you have to provide your name and the comment. Your e-mail address is optional and you only need to provide it if you want me to contact you. It will not be displayed along with your comment. I got sick and tired of the comment spam I was receiving, so I have protected this page with a simple calculation exercise. This means that if you want to leave a comment, you'll need to complete the calculation before you hit the Post Comment button.

If you want to object to a comment made by another visitor, be sure to contact me and I'll look into it ASAP. Don't forget to mention the page link, or the Doc ID of the document.

(Plain text only; no HTML or code that looks like HTML or XML. In other words, don't use < and >. Also no links allowed.