After upgrading to the newest Visual Studio 2022 and NCrunch 4.18 (not sure which upgraded caused the problems), I can no longer build Blazor WASM projects.
I am getting the following error message:
..\..\..\..\Program Files\dotnet\sdk\7.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets (167, 5): The "ComputeBlazorBuildAssets" task was not given a value for the required parameter "DotNetJsVersion".
I have set IsWasmProject = false in the NCrunch project configuration.
Remco NCrunch Developer
#16807
20 Aug 2023 10:44 UTC
Hi, thanks for sharing these details. Is this a problem you're able to reproduce with a sample solution that you can share with me? If so, are you able to submit it through the contact form?
Sure -- an empty example from the Blazor WASM template in Visual Studio reproduces this. I have sent it to you via the form.
Remco NCrunch Developer
#16810
21 Aug 2023 11:07 UTC
Thanks for sending this through. I've reproduced the problem exactly as you've described it.
The problem is caused by a recent change in VS that causes Blazor WASM project builds to break whenever they are built with SelfContained=false. From what I understand, this type of project isn't something that MS want to support without it being run with a self contained publishing mode.
Under NCrunch, we force SelfContained=false because otherwise the build system slips an undeclared framework reference in that points to a platform target specific to this type of project. This causes problems with our ability to synchronise with grid nodes, as we need to know which packages are required by a project up-front before we try to build them on nodes.
Could you please try adding SelfContained=True for this project under your NCrunch 'Custom build properties' setting?
I hope that this will suppress the issue. If you're using distributed processing with this project, you'll need to perform a manual package restore on the remote nodes to make sure the required runtime pack is installed (the error will tip you off on this). If you're only running NCrunch locally, this shouldn't be an issue for you.
I'm submitting a fix to NCrunch to force SelfContained=true for Blazor WASM projects in future released builds.
The problem is caused by a recent change in VS that causes Blazor WASM project builds to break whenever they are built with SelfContained=false. From what I understand, this type of project isn't something that MS want to support without it being run with a self contained publishing mode.
Under NCrunch, we force SelfContained=false because otherwise the build system slips an undeclared framework reference in that points to a platform target specific to this type of project. This causes problems with our ability to synchronise with grid nodes, as we need to know which packages are required by a project up-front before we try to build them on nodes.
Could you please try adding SelfContained=True for this project under your NCrunch 'Custom build properties' setting?
I hope that this will suppress the issue. If you're using distributed processing with this project, you'll need to perform a manual package restore on the remote nodes to make sure the required runtime pack is installed (the error will tip you off on this). If you're only running NCrunch locally, this shouldn't be an issue for you.
I'm submitting a fix to NCrunch to force SelfContained=true for Blazor WASM projects in future released builds.
Thank you. That fixed the issue!
For the record, I am only running NCrunch locally.
Excellent customer support and response time from you, as usual.
For the record, I am only running NCrunch locally.
Excellent customer support and response time from you, as usual.
Note that the Remco answer also fix the build issue for a Blazor .NET 8 app with dual interactivity mode
Post a reply
Log in to reply.