Build/Test Issues

Assemblies fail to load with The target "_SplitProjectReferencesByFileExistence" doesn't exist

Started by wibarr on 5,172 views

Hi everyone,

I just installed NCrunch and am running into the following error loading any of our projects:

System.Exception: An exception was thrown in the remote environment: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> nCrunch.Common.UserException: Errors occurred while trying to load the project file: 
The target "_SplitProjectReferencesByFileExistence" does not exist in the project.
   at nCrunch.Compiler.RemoteBuildRunner.(FilePath ,   , String , String , DirectoryPath , String )
   at nCrunch.Compiler.RemoteBuildRunner.AnalyseComponentBuild(FilePath projectFilePath, BuildXml buildXml, String useBuildConfiguration, String useBuildPlatform, DirectoryPath solutionDir, String solutionName, List`1 importExpressionsToEvaluate)
   --- 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.RemoteInstance.[T](Byte[] )
   at nCrunch.TaskRunner.Ipc.RemoteInstance.Invoke(IMessage msg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at nCrunch.Compiler.IRemoteBuildRunner.AnalyseComponentBuild(FilePath projectFilePath, BuildXml buildXml, String useBuildConfiguration, String useBuildPlatform, DirectoryPath solutionDir, String solutionName, List`1 importExpressionsToEvaluate)
   at nCrunch.Core.BuildManagement.BuildProcessLauncher..(IRemoteBuildRunner )
   at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , ProcessorArchitecture , GridClientId , IBuildableProject , CustomEnvironmentVariable[] )
   at nCrunch.Core.BuildManagement.BuildProcessLauncher.AnalyseComponentBuildInExternalProcess(FilePath projectFilePath, BuildXml buildXml, String useBuildConfiguration, String useBuildPlatform, DirectoryPath solutionDir, String solutionName, List`1 importExpressionsToEvaluate, ProcessorArchitecture processorArchitecture, VisualStudioVersion vsVersion, CustomEnvironmentVariable[] customEnvironmentVariables)
   at nCrunch.Client.ComponentLoader.SnapshotComponentFactory.(ProcessorArchitecture )
   at nCrunch.Client.ComponentLoader.SnapshotComponentFactory.CreateSnapshotComponentFromXml(FilePath projectFilePath, BuildXml projectXml, FilePath solutionFilePath, String[] additionalFilesToIncludeAtSolutionLevel, Boolean isLoadedFromFile, ISnapshotConfig snapshotConfig, VisualStudioVersion vsVersion)



The solution file is dynamically generated from a subset of projects due to the overall size of the codebase and number of projects, but I've verified that when I go to the command line, I can execute msbuild /t:_SplitProjectReferencesByFileExistence on each of the projects without problems. Where is NCrunch looking for this target?

Thanks!
Hi, thanks for sharing this issue.

The _SplitProjectReferencesByFileExistence target is part of the normal build target chain for most projects on the .NET platform. Usually when NCrunch's analysis build fails to find the target, this means that problem is with an include somewhere that has been missed. It's possible this is related to inconsistencies with build platform/configuration - see here for more details on this: http://www.ncrunch.net/documentation/considerations-and-constraints_project-build-platform-and-configuration[http://www.ncrunch.net/documentation/considerations-and-constraints_project-build-platform-and-configuration.

It's worth closely examining how this project file is including targets from the .NET framework. Check for conditions that might exist on the include statements. Custom-made or heavily modified projects can sometimes contain arrangements that NCrunch hasn't been tested for and the projects likely won't have been designed with NCrunch builds in mind.
Hmm, I see.

Is there any way for ncrunch to emit the commands it's attempting to use to build the project or find that particular target? It's a bit obscured for me as, since it works when I use VS or the command line to build.
Try setting the 'Log Verbosity' (global config setting) to 'Detailed', and turn on the 'Log to output window' setting. NCrunch should start dumping lots of information inside the NCrunch VS output window. This should also include details from the analysis build NCrunch is running against the project.

Post a reply

Log in to reply.