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

Notification

Icon
Error

Build error for net6 blazor webassembly project
MaxRonin
#1 Posted : Saturday, January 8, 2022 3:40:41 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 3/18/2016(UTC)
Posts: 32
Location: Austria

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
Hi,

I got a net 6 blazor (client-only) project that NCrunch refuses to build with the error message:
Quote:

NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ng_project-build-issues
..\..\..\..\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\6.0.1\Sdk\WasmApp.targets (161, 5): Could not find %(ResolvedRuntimePack.PackageDirectory)=


I am on the latest version of NCrunch.

The project file uses Sdk="Microsoft.NET.Sdk.BlazorWebAssembly" and <TargetFramework>net6.0</TargetFramework>

Following the only hit I found googling for ncrunch and blazor, I tried setting a custom build property BlazorWebAssemblyEnableLinking with the value false, but this didn't change anything.

So what do I need to do to get NCrunch to build this?

Thanks,
Max
1 user thanked MaxRonin for this useful post.
brcaswell on 6/18/2022(UTC)
Remco
#2 Posted : Saturday, January 8, 2022 11:54:47 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi Max,

Thanks for sharing this issue. I'll need a sample solution that can reproduce this issue to provide more detailed troubleshooting (unfortunately just pointing at the WebAssembly package doesn't seem to be enough to produce the issue), but I've had a look through the package source and there may be some opportunities to disable the package inside the NCrunch build system.

What happens if you use the NCrunch 'Custom build properties' setting to set the 'IsWasmProject' property to 'false'?
1 user thanked Remco for this useful post.
MaxRonin on 1/10/2022(UTC)
emsurgecto
#3 Posted : Monday, January 10, 2022 12:26:46 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/10/2022(UTC)
Posts: 9
Location: United Kingdom

Thanks: 2 times
Was thanked: 3 time(s) in 3 post(s)
I had the same issue and can confirm setting 'IsWasmProject' to 'false' solved it for me.

Thank you both!
MaxRonin
#4 Posted : Monday, January 10, 2022 5:33:14 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 3/18/2016(UTC)
Posts: 32
Location: Austria

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
Hi Remco,

that did the trick, thank you! Out of curiosity: why "false"? From the name of the property you'd think it oughta be true?

Cheers,
Max
Remco
#5 Posted : Monday, January 10, 2022 10:00:38 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
MaxRonin;15929 wrote:

that did the trick, thank you! Out of curiosity: why "false"? From the name of the property you'd think it oughta be true?


The issue is caused by build steps inside the webassembly package that don't like NCrunch's workspacing. By setting this property to 'False', we trigger a condition on one of the critical build targets in this package that causes it not to run. As such, the build steps don't run at all and never encounter any errors. I'm gambling here that the build steps aren't required for your tests to run. They look like they exist more for packaging than critical preparation for a runtime environment.
1 user thanked Remco for this useful post.
MaxRonin on 1/11/2022(UTC)
wendellm
#6 Posted : Tuesday, January 11, 2022 10:52:44 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/16/2017(UTC)
Posts: 2
Location: Belgium

Thanks: 1 times
with the same setup, updated to preview 2 .net 6, I am running into the same problem. Blazor wasm refusing to build.
I want to try this above solution but I have no clue what this means? => NCrunch 'Custom build properties' setting to set the 'IsWasmProject' property to 'false'
And example would be greatly appreciated.

And whats with the 1990s forum look and feel ? ;)
Remco
#7 Posted : Tuesday, January 11, 2022 11:10:02 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
wendellm;15933 wrote:
with the same setup, updated to preview 2 .net 6, I am running into the same problem. Blazor wasm refusing to build.
I want to try this above solution but I have no clue what this means? => NCrunch 'Custom build properties' setting to set the 'IsWasmProject' property to 'false'
And example would be greatly appreciated.


You'll need to find this configuration option inside your NCrunch Configuration window - custom build properties.

Make sure to set it for the blazor project itself (probably best as a shared setting).

Create a property called 'IsWasmProject'. Set it to 'False'.

wendellm;15933 wrote:

And whats with the 1990s forum look and feel ? ;)


Didn't you hear? Retro forums are all the rage these days. We've nearly finished work on our animated flashing banner to sit at the top of the site..
1 user thanked Remco for this useful post.
wendellm on 1/11/2022(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.055 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download