Build/Test Issues

.NET 5 unit test projects not building

Started by Argamon on 1,974 views

I have a few .NET 5 unit tests projects where NCrunch is not building them.

When I use MSBuild everything compiles fine.

The error message in the NCrunch build window shows the following:
[21:11:07.8837-LocalBuildTask-21] ERROR (Internal): System.IO.IOException: The path '' could not be processed because it is not of legal form
   at nCrunch.Common.IO.DiskPath..ctor(String absolutePath, Boolean pathIsChecked)
   at nCrunch.Common.IO.DirectoryPath.FromAbsolutePath(String absoluteFilePath)
   at nCrunch.Core.PlatformTypes.DotNetCore.DotNetCoreSdk. (EffectiveProcessorArchitecture)
   at nCrunch.Core.PlatformTypes.DotNetCore.DotNetCoreSdk.GetToolPath(EffectiveProcessorArchitecture effectiveProcessorArchitecture)
   at nCrunch.Core.PlatformTypes.DotNetCore.DotNetCoreSdk.GetFallbackFolderPath(EffectiveProcessorArchitecture processorArchitecture)
   at nCrunch.Core.PlatformTypes.DotNetCore.DotNetCoreBuildExtender. (SnapshotComponent  , FilePath , DirectoryPath[] )
   at nCrunch.Core.PlatformTypes.DotNetCore.DotNetCoreBuildExtender. (SnapshotComponent  , BuildOutput )
   at nCrunch.Core.PlatformTypes.DotNetCore.DotNetCoreBuildExtender.ProcessSuccessfulBuildOutput(SnapshotComponent component, BuildOutput buildOutput, IList`1 componentReferences)
   at nCrunch.Core.BuildManagement.BuildEnvironment.Build(SnapshotComponent snapshotComponentToBuild, IList`1 referencedComponents, GridClientId gridClientId, IList`1 customEnvironmentVariables, IPlatformBuildExtender extender, Guid taskId, GridAddress clientAddress, Boolean extractCoverageReportStructure)
   at nCrunch.Core.Processing.BuildTaskLogic.DoProcessTaskAndReturnSuccessFlag()
   at nCrunch.Core.Processing.TaskLogic.ProcessTaskAndReturnSuccessFlag()
   at nCrunch.Client.Processing.LocalProcessingTask.ProcessTaskAndReturnSuccessFlag()
   at nCrunch.Client.Processing.ProcessingQueue.()


This problem exists now for a while and was also present when these projects still where configured with .NET Core 3.1 as target platform.

What is even more strange is, that sometimes after a do a reboot of my machine they work for a while.

Do you have any clue what is going on or how I can investigate this further? I mean some path is not set, but which one and why?
Hi, thanks for sharing this problem.

It looks like NCrunch is unable to resolve the path of your ProgramFiles directory.

Can you check if you have the ProgramFiles, ProgramFiles(x86) and ProgramW6432 environment variables set on your machine? These should point to the x86, x86 and x64 program files directories on your system respectively.
Remco wrote:Hi, thanks for sharing this problem.

It looks like NCrunch is unable to resolve the path of your ProgramFiles directory.

Can you check if you have the ProgramFiles, ProgramFiles(x86) and ProgramW6432 environment variables set on your machine? These should point to the x86, x86 and x64 program files directories on your system respectively.


Thx for the reply, but I dont think that is the problem.

I opened a fresh PowerShell console:
Get-ChildItem env:Program*

Name                           Value
----                           -----
ProgramW6432                   C:\Program Files
ProgramFiles                   C:\Program Files
ProgramData                    C:\ProgramData
ProgramFiles(x86)              C:\Program Files (x86)


Does look right for me.

I spend a little thought on your words and tried a different approach. Normally I double click the Solution File (with getting the error).

So I started a fresh Visual Studio and clicked there on open solution. And it worked.

So it has definitly something to do with the environment. Still no real clue why this happens every few days and only with .NET Core projects, never with Framework projects

Edited

Argamon wrote:

So it has definitly something to do with the environment. Still no real clue why this happens every few days and only with .NET Core projects, never with Framework projects


Since a recent VS update, we've noticed that the IDE doesn't always seem to behave correctly when opening directly to a solution. This seems to be a newly introduced problem, and it messes with the calls that the IDE makes to installed packages. For the time being, I recommend avoiding opening directly to a solution and instead open the solution after starting the IDE.

Post a reply

Log in to reply.