Build/Test Issues

_SplitProjectReferencesByFileExistence

Started by ThatGuyDuncan on 6,260 views

I get this associated with three different projects in my solution. I have been cutting recently because it *appeared* that NuGet was not completely removing references in the .proj files to Microsoft.Net.Compilers, so perhaps I cut too much (but that would mean I had made a mistake, and of course *that* can't be it!).


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 , LoadTimeQuery , String , String , DirectoryPath , String , String )
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.RemoteInstance.(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(ComponentLoadParameters parameters)
at nCrunch.Core.BuildManagement.BuildProcessLauncher..(IRemoteBuildRunner )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , FilePath , String , ExternalProcess )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , ProcessorArchitecture , GridClientId , BuildSystemParameters , IList`1 )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.AnalyseComponentBuildInExternalProcess(ComponentLoadParameters parameters, IList`1 customEnvironmentVariables)
at nCrunch.Client.ComponentLoader.SnapshotComponentLoader.(ProcessorArchitecture , String )
at nCrunch.Client.ComponentLoader.SnapshotComponentLoader.CreateComponentFromXml(FilePath projectFilePath, ParsedBuildXml projectXml, FilePath solutionFilePath, String[] additionalFilesToIncludeAtSolutionLevel, Boolean isLoadedFromFile, VisualStudioVersion vsVersion, ComponentUniqueName componentName, TaskSettings componentTaskSettings, Exception parseException, String targetFramework)

Hi, thanks for posting.

Generally, when I've seen this problem, it's because MSBuild wasn't able to resolve the .targets files that were necessary to build the project. The solution to this will depend on how your build system is structured. Somewhere in the project (or in its related imports) there must be an <Import> for the standard MSBuild targets files. If you've been removing things from the project, it's possible you may have removed a critical import tag.
This post has been deleted.
franckyj wrote:We've been bitten by this for 24 hours now and in the end it was because we installed a new version of powershell and we forgot to add the new path to the user path variable. I'm guessing ncrunch or msbuild uses powershell for some tasks and it couldn't find it. This is the explanation given to me by our sysadmins.

A telltale sign that it was this issue was that it would work when I would log in with my AD user when doing the build + ncrunch steps but it wouldn't work with the build user.

Hoping this might help other developers struggling with this issue in the future!


Thanks for taking the time to post this here!

NCrunch relies on MSBuild's internal logic when loading projects. Usually, this problem results from MSBuild being unable to resolve the .targets files used by the project when at load time. Often the .targets files are referenced using environment variables, so I suppose it's possible that installing powershell changed a critical variable on your system. NCrunch itself has no integration with powershell, but when using MSBuild, anything becomes possible.

Post a reply

Log in to reply.