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

Notification

Icon
Error

$(MicrosoftNetCoreAppRuntimePackDir)='', and cannot find %(ResolvedRuntimePack.PackageDirectory)=
kpspence
#1 Posted : Sunday, March 19, 2023 6:15:35 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/18/2022(UTC)
Posts: 5
Location: United States of America

Was thanked: 2 time(s) in 2 post(s)
.net client project Bazor webassembly is failing to build <Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

The error is:
..\..\..\..\..\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\7.0.4\Sdk\WasmApp.targets (216, 5): $(MicrosoftNetCoreAppRuntimePackDir)='', and cannot find %(ResolvedRuntimePack.PackageDirectory)=. One of these need to be set to a valid path

The file referenced translate to:
C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\7.0.4\Sdk\WasmApp.targets
This file is present.
Remco
#2 Posted : Sunday, March 19, 2023 8:22:18 PM(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 sharing this issue.

Can you share any more details about how this particular project was constructed? When I create a standard webassembly blazor project, I don't seem to get this issue under NCrunch. I think this is caused by a complicated set of dependencies.

If you're able to share the XML for the project, this might be enough for me to reproduce the issue.
kpspence
#3 Posted : Monday, March 20, 2023 10:36:41 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/18/2022(UTC)
Posts: 5
Location: United States of America

Was thanked: 2 time(s) in 2 post(s)
When I create a brand new Blazor Webassembly App, .NET 7, Configure for https and enable ncrunch. I get the below error.

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!--This is a custom NCrunch file format-->
<solution path="C:\data\vsTest\NcrunchBugBlazorApp1\NcrunchBugBlazorApp1.sln">
<project name="NcrunchBugBlazorApp1" path="C:\data\vsTest\NcrunchBugBlazorApp1\NcrunchBugBlazorApp1\NcrunchBugBlazorApp1.csproj">
<loadErrors />
<build>
<buildTime>00:00:02.790</buildTime>
<errors>
<error>C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\7.0.4\Sdk\WasmApp.targets (216): $(MicrosoftNetCoreAppRuntimePackDir)='', and cannot find %(ResolvedRuntimePack.PackageDirectory)=. One of these need to be set to a valid path</error>
</errors>
<warnings />
</build>
<tests />
</project>
</solution>

My project is here: https://github.com/kpspence/ncrunch

I think it has to do with configuration some how because it was working on my previous laptop. Just at a loss for what is different.
Remco
#4 Posted : Monday, March 20, 2023 11:48:42 PM(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 sharing the sample project.

Interesting, the project doesn't seem to reproduce the error on my machine. I've tried variations in install state (i.e. VS with blazor installed and without), yet for some reason my build logic doesn't seem to reference or include the file responsible. There must be an environmental or installation component to this issue that I can't figure out.

What happens if you use the NCrunch 'Custom build properties' setting to set the 'IsWasmProject' property to 'false'?
kpspence
#5 Posted : Tuesday, March 21, 2023 3:05:30 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/18/2022(UTC)
Posts: 5
Location: United States of America

Was thanked: 2 time(s) in 2 post(s)
After comparing the two computers:

Renaming C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk to C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk2 fixed the issue

Setting the NCrunch 'Custom build properties' setting to set the 'IsWasmProject' property to 'false'? This also worked.

Thank you.
1 user thanked kpspence for this useful post.
Remco on 3/21/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.037 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download