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

Notification

Icon
Error

.NET 5 unit test projects not building
Argamon
#1 Posted : Saturday, January 30, 2021 8:23:44 PM(UTC)
Rank: Member

Groups: Registered
Joined: 12/4/2018(UTC)
Posts: 12
Location: Germany

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
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:
Code:
[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?
Remco
#2 Posted : Saturday, January 30, 2021 10:27:16 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)
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.
Argamon
#3 Posted : Sunday, January 31, 2021 8:52:07 AM(UTC)
Rank: Member

Groups: Registered
Joined: 12/4/2018(UTC)
Posts: 12
Location: Germany

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Remco;15287 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:
Code:
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
Remco
#4 Posted : Sunday, January 31, 2021 12:08: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)
Argamon;15288 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.
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