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

Notification

Icon
Error

Load failure
CGaskell
#1 Posted : 13 days ago
Rank: Newbie

Groups: Registered
Joined: 3/18/2025(UTC)
Posts: 3
Location: United Kingdom

Thanks: 1 times
Hi,

I'm running a relatively simple dotnet9 WebAPI solution with 4 projects and 2 test projects.

NCrunch v5.12.0.10

One project has simple helpers and NCrunch wont build it. I'd appreciate any help.

Heres my Directory.Build.props
Quote:

<Project>
<PropertyGroup>
<ImportDirectoryBuildProps>false</ImportDirectoryBuildProps>

<TargetFramework>net9.0</TargetFramework>
<LangVersion>13.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

<TreatWarningsAsErrors>True</TreatWarningsAsErrors>

<NoWarn>$(NoWarn);NU1803;NU1603;NU3005;CA1416</NoWarn>

<!-- Enable .NET code analysis -->
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisLevel>latest</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>

</PropertyGroup>
</Project>


Quote:

System.Exception: An exception was thrown in the remote environment: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at nCrunch.Compiler.BuildXml.AddTargetScript(String targetName, String dependsOnTargets, String targetScript)
at nCrunch.Compiler.LoadTimeQuery..ctor(BuildXml buildXml, IList`1 importExpressions, IPlatformTypeFactory[] platformTypeFactories, IList`1 loadTimeQueryDeclarations, Boolean supportsBeforeTargets)
at nCrunch.Compiler.ComponentAnalysisContext..ctor(ComponentLoadParameters loadParameters, IBuildableProject buildableProject, DirectoryPath baseIntermediateOutputPath, DirectoryPath msBuildDirectory)
at nCrunch.Compiler.RemoteBuildRunner.AnalyseComponentBuild(ComponentLoadParameters parameters)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.(CallMethodMessage )
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.ProcessMessageReturningResult(Byte[] data)
at nCrunch.TaskRunner.Ipc.RemoteProxyCommunicator.(Byte[] )
at nCrunch.TaskRunner.Ipc.RemoteProxyCommunicator.Invoke(String methodName, Object[] args)
at nCrunch.Compiler.RemoteBuildRunnerProxy.AnalyseComponentBuild(ComponentLoadParameters parameters)
at nCrunch.Core.BuildManagement.BuildProcessLauncher..(IRemoteBuildRunner )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , FilePath , String , DirectoryPath , ExternalProcess )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , EffectiveProcessorArchitecture , GridClientId , BuildSystemParameters , IList`1 , Nullable`1 , GridClientDescription , DotNetCoreSdkVersion  )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.AnalyseComponentBuildInExternalProcess(ComponentLoadParameters parameters, IList`1 customEnvironmentVariables)
at nCrunch.Client.ComponentLoader.SnapshotComponentLoader.(EffectiveProcessorArchitecture , String )
at nCrunch.Client.ComponentLoader.SnapshotComponentLoader.CreateComponentFromXml(FilePath projectFilePath, ParsedBuildXml projectXml, FilePath solutionFilePath, String[] additionalFilesToIncludeAtSolutionLevel, Boolean isLoadedFromFile, IDEVersion ideVersion, BuildEngineId buildEngineId, ComponentUniqueName componentName, TaskSettings componentTaskSettings, Exception parseException, String targetFrameworkForMsbuild, String visibleTargetFramework)

Remco
#2 Posted : 13 days ago
Rank: NCrunch Developer

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

Thanks: 975 times
Was thanked: 1313 time(s) in 1218 post(s)
Hi, thanks for sharing this.

Does the affected project have a closing tag? There needs to be a </Project> at the bottom of the file.
CGaskell
#3 Posted : 13 days ago
Rank: Newbie

Groups: Registered
Joined: 3/18/2025(UTC)
Posts: 3
Location: United Kingdom

Thanks: 1 times
It doesnt, the file is

<Project Sdk="Microsoft.NET.Sdk" />
Remco
#4 Posted : 13 days ago
Rank: NCrunch Developer

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

Thanks: 975 times
Was thanked: 1313 time(s) in 1218 post(s)
Can you modify it so instead it is:

<Project Sdk="Microsoft.NET.Sdk"></Project>

This should work around the problem.
CGaskell
#5 Posted : 13 days ago
Rank: Newbie

Groups: Registered
Joined: 3/18/2025(UTC)
Posts: 3
Location: United Kingdom

Thanks: 1 times
Yes, just tried it, NCrunch is running fine. Thanks
Remco
#6 Posted : 13 days ago
Rank: NCrunch Developer

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

Thanks: 975 times
Was thanked: 1313 time(s) in 1218 post(s)
CGaskell;17993 wrote:
Yes, just tried it, NCrunch is running fine. Thanks


Thanks for confirming. I'll see what I can do about introducing a proper fix.
1 user thanked Remco for this useful post.
CGaskell on 3/18/2025(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.047 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download