Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Blazor WASM project build fails
jotto
#1 Posted : Sunday, August 20, 2023 8:10:44 AM(UTC)
Rank: Member

Groups: Registered
Joined: 3/12/2013(UTC)
Posts: 13
Location: Norway

Was thanked: 5 time(s) in 5 post(s)
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.
1 user thanked jotto for this useful post.
emsurgecto on 9/4/2023(UTC)
Remco
#2 Posted : Sunday, August 20, 2023 10:44:10 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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?
jotto
#3 Posted : Sunday, August 20, 2023 3:28:00 PM(UTC)
Rank: Member

Groups: Registered
Joined: 3/12/2013(UTC)
Posts: 13
Location: Norway

Was thanked: 5 time(s) in 5 post(s)
Sure -- an empty example from the Blazor WASM template in Visual Studio reproduces this. I have sent it to you via the form.
Remco
#4 Posted : Monday, August 21, 2023 11:07:34 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
2 users thanked Remco for this useful post.
emsurgecto on 9/4/2023(UTC), htssoftwares on 12/31/2023(UTC)
jotto
#5 Posted : Friday, August 25, 2023 5:46:25 PM(UTC)
Rank: Member

Groups: Registered
Joined: 3/12/2013(UTC)
Posts: 13
Location: Norway

Was thanked: 5 time(s) in 5 post(s)
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.
1 user thanked jotto for this useful post.
Remco on 8/25/2023(UTC)
htssoftwares
#6 Posted : Sunday, December 31, 2023 10:25:05 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/10/2020(UTC)
Posts: 6
Location: France

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Note that the Remco answer also fix the build issue for a Blazor .NET 8 app with dual interactivity mode
1 user thanked htssoftwares for this useful post.
Remco on 12/31/2023(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.047 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download