Build/Test Issues

Build error for net6 blazor webassembly project

Started by MaxRonin on 3,584 views

Hi,

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

NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/documentation/troubleshooting_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
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'?
I had the same issue and can confirm setting 'IsWasmProject' to 'false' solved it for me.

Thank you both!
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
MaxRonin 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.
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 ? ;)
wendellm 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 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..

Post a reply

Log in to reply.