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

Notification

Icon
Error

Cannot run NCrunch due to hostfxr.dll
thobey
#1 Posted : Wednesday, September 14, 2022 6:54:51 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/14/2022(UTC)
Posts: 4
Location: Sweden

I get this error when I try to run NCrunch. I cannot understand what kind of prereq I am missing. Have anyone had this problem and has a solution?

Detected latest fxr version=[C:\Program Files (x86)\dotnet\host\fxr\6.0.8]...
Resolved fxr [C:\Program Files (x86)\dotnet\host\fxr\6.0.8\hostfxr.dll]...
Failed to load the dll from [C:\Program Files (x86)\dotnet\host\fxr\6.0.8\hostfxr.dll], HRESULT: 0x800700C1
The library hostfxr.dll was found, but loading it from C:\Program Files (x86)\dotnet\host\fxr\6.0.8\hostfxr.dll failed
- Installing .NET prerequisites might help resolve this problem.
https://go.microsoft.com/fwlink/?linkid=798306
Remco
#2 Posted : Thursday, September 15, 2022 12:02:48 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 952 times
Was thanked: 1280 time(s) in 1187 post(s)
Hi, thanks for sharing this problem.

I haven't seen this one before. I agree it looks like something needs to be (re)installed. Where do you receive this error? Does it happen when NCrunch tries to discover tests?
thobey
#3 Posted : Thursday, September 15, 2022 10:02:19 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/14/2022(UTC)
Posts: 4
Location: Sweden

The problem occurs when the tests are built and Ncrunch is trying to analysing them. The same solution works fine with NCrunch on another machine, and I cannot figure out what the difference is regarding installed frameworks. Both have Dotnet 6.
Remco
#4 Posted : Thursday, September 15, 2022 12:28:02 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 952 times
Was thanked: 1280 time(s) in 1187 post(s)
It looks like this is resolving to the x86 (32-bit) path of dotnet. Is it possible you installed the x86 build of dotnet by accident, but meant to get x64 instead?
thobey
#5 Posted : Thursday, September 15, 2022 1:15:05 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/14/2022(UTC)
Posts: 4
Location: Sweden

I want to build for X86. And I have stated that in the configuration in NCrunch under "Use Cpu architecture"
Remco
#6 Posted : Thursday, September 15, 2022 11:32:10 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 952 times
Was thanked: 1280 time(s) in 1187 post(s)
thobey;16268 wrote:
I want to build for X86. And I have stated that in the configuration in NCrunch under "Use Cpu architecture"


Can you confirm whether your project is built to target the X86 platform?

We've found working with X86 can sometimes be more trouble than it's worth under the newer versions of .NET. Unless you have a reason for needing to deploy under x86, I do recommend using the x64 version of Dotnet where possible.
thobey
#7 Posted : Friday, September 16, 2022 6:18:25 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/14/2022(UTC)
Posts: 4
Location: Sweden

We need to deploy under x86. As I said, the same solution works on another computer. I have just changed to a new computer, and I am trying to figure out what kind of dependency/prereq I am missing. Running the tests normally with MSTest works of course.
Remco
#8 Posted : Saturday, September 17, 2022 12:01:09 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 952 times
Was thanked: 1280 time(s) in 1187 post(s)
Could you please check the following?

- Make sure all recent windows updates are installed (see here for interesting Q&A)
- Try disabling any virus scanner running on your system
- Try a uninstalling this version of the dotnet runtime and check with an earlier minor release of .net6

Also of interest: https://github.com/dotnet/sdk/issues/4240.

I suspect there is something in the platform that can do this. Note that VSTest working does not mean this problem is specific to NCrunch, as VSTest can often resolve to an entirely different version of .NET (it does not align precisely to your targeted platform version).
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