Unable to build new project

I just installed the Alpha kit, and created a new server project, which fails to build with the output window showing the error: Could not load file or asssembly 'Nuget.Frameworks, Version='

dotnet nuget --version shows

I have the current SDK installed. (6.0.400 and 7.0.100-preview)

Found this in the log: [2022-09-06 06:50:08.666] [error] Error: System.NullReferenceException: Object reference not set to an instance of an object.
at Radzen.Server.RazorProjectEngineExtensions.GetComponentDescriptors(RazorProjectEngine engine, Compilation compilation) in /Users/korchev/github/radzen-next/Radzen.Server/RazorProjectEngineExtensions.cs:line 27
at Radzen.Server.RazorProjectEngineExtensions.SerializeComponentDescriptors(RazorProjectEngine engine, Compilation compilation) in /Users/korchev/github/radzen-next/Radzen.Server/RazorProjectEngineExtensions.cs:line 71
at Radzen.Server.ProjectServer.Toolbox() in /Users/korchev/github/radzen-next/Radzen.Server/ProjectServer.cs:line 109

Am I missing something?


Hi @BlazorSaddles,

Unfortunately this isn't a known issue. Getting this error means that for some reason this package cannot be restored. Does the application run from command line via dotnet run? There is a chance .NET 7 preview interferes in some way but we are not sure.

Just tried the dotnet run and the site works. I uninstalled the .NET 7 preview, but that didn't solve the problem.

I did finally find the cause. The latest version of VS 2022 has been updated to 17.3.3 which includes support for .NET MAUI. It appears that in order to support MAUI, VS still requires a pre-release of MSBuild. So, when a project is opened in RBS, the first line in the Output box shows the version - MSBuild version 17.3.0-preview-22329. If I uninstall VS, the build is successful.

Hmmm, should I do my Blazor development in Visual Studio or RBS? :scream:

Did some more testing of different versions of VS2022. I am able to have both VS2022 and RBS Alpha if the highest version of VS2022 is 17.2.7 LTSC, which can be found here: Visual Studio 2022 Release History | Microsoft Docs

I'm excited to start learning RBS. I have our software engineering manager interested in getting off of Web Forms and moving to Blazor. One of his directives from the CEO is to cut the cost of developing software, so I am anxious to show that this is the product for them. Hopefully all the developers will have their own copy.

Hope this explanation helps,


Just found another problem caused by the preview version of MSBuild. The preview version is installed by the .NET SDK 6.0.400. That SDK is required by RBS Alpha for WASM projects.

Hi @BlazorSaddles,

Thank you for investigating further! We will try installing the same version of VS2022 and hopefully this will allow us to reproduce this problem and release a fix for it. RBS is intended to work side by side with Visual Studio.

I installed VS2022 17.3.3 but all projects ran successfully from RBS. However dotnet nuget --version prints

$ dotnet nuget --version
NuGet Command Line

Which is the version that is dotnet is looking for at your side. It seems for some reason the nuget you have installed is older than it is supposed to. Maybe installing .NET 6 again would fix that?

It was getting late in the evening, and I made a mistake when I said RBS required SDK 6. 0.400 --- it was Visual Studio that needed it.

My nuget is currently, so that's too low. Is nuget installed by SDK?

I'll keep at it until I get the correct combination on versions.

As far as I know it is installed with the .NET SDK.

After many hours of cleanup of installed SDKs, reinstalling Visual Studio multiple times, I finally have been able to get the $dotnet nuget to the correct version. (I just love troubleshooting by trial and error)

It all that had to do with the preview of Visual Studio that was installed. Even though I uninstalled the preview, the preview 7 SDK remained in the folder:

C:\Program Files\dotnet\sdk\7.0.100-preview.6.22352.1

I renamed the folder (in case I needed it again) and voila' the dotnet nuget version changed from .104 to .128.

Started with:

$dotnet --version
$dotnet nuget --version


$dotnet --version
$dotnet nuget --version

I did some research to see if there is a way to specify which SDK version should be used as "current". This link discusses how: Select the .NET version to use. I tried creating a Global.json file as described in: How to Change Default DotNet SDK Version - DEV Community 👩‍💻👨‍💻 and it worked. This link has a summary of the topic: https://www.markheath.net/post/switching-between-netcore-sdk-versions. Maybe some of this info can be used for RBS.

Test of a RBS server project worked properly. On the other hand, the WASM project failed. I created a new WASM project with RBS, clicked Run and the browser displayed the unhandled exception Reload message. The dev tools Console shows:

System.ArgumentException: Hashtable's capacity overflowed and went negative. Check load factor, capacity and the current size of the table. (Parameter 'capacity')

There was nothing in the log file (other than the checking for update messages).

Created a new Blazor WASM project with VS2022, and it ran properly. Opened and ran the project with RBS, and the same System.ArgumentException occurred. No errors in the log.

RBS runs the application by just executing dotnet run in the Server directory. What happens if you do that manually (for both the RBS created and VS created ones)?

FWIW here is how things are supposed to work in similar environment (it is a tad slow because running in a VM).

If I run the VS project in debug mode, it runs. Non-debug mode fails. Running dotnet run also fails.

It's looking like I need to repair dotnet...

Well, I sure feel like an idiot! After all this time trying to repair dotnet, in a last act of desperation, I did a repair on the Edge browser...and now it all works. :roll_eyes:

Now I can get back to my original goal of learning RBS!

That's odd indeed. Never would it occur to me that Edge could be the culprit! I thought Blazor is more or less browser-agnostic.