Everything working fine yesterday.....
Windows update overnight to OS Build: 19043.1110
Running:
VS 2019 16.10.3
NCrunch 4.9.0.8
22 Projects, mostly .Net 4.7
One Blazor project (.Net 5.0) and this is the one that NCrunch is having issues loading (Load Failure). It builds and runs perfectly in Visual Studio.
The same solution still works on my Laptop OK (NCrunch loads projects), but I have not yet updated that.
I'm looking for ideas of where to look for the problem.
Thanks!
-------------------
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.ComponentAnalysisContext.()
at nCrunch.Compiler.ComponentAnalysisContext.AnalyseComponentBuild()
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 , EffectiveProcessorArchitecture , GridClientId , BuildSystemParameters , IList`1 , Nullable`1 , GridAddress )
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, VisualStudioVersion vsVersion, ComponentUniqueName componentName, TaskSettings componentTaskSettings, Exception parseException, String targetFrameworkForMsbuild, String visibleTargetFramework)
Build/Test Issues
The target "_SplitProjectReferencesByFileExistence" does not exist in the project.
Started by DavidPartington on 4,163 views
Remco NCrunch Developer
#15528
15 Jul 2021 13:28 UTC
Hi, thanks for sharing this issue.
This error is a catch-all thrown up by MSBuild when it can't resolve the base system targets from the project file.
Can you confirm if this project file builds normally using MSBuild via the command line?
... And could you submit an NCrunch bug report after the load failure?
This error is a catch-all thrown up by MSBuild when it can't resolve the base system targets from the project file.
Can you confirm if this project file builds normally using MSBuild via the command line?
... And could you submit an NCrunch bug report after the load failure?
Edited 15 Jul 2021 13:30 UTC
I have submitted the bug report as requested.
I'm not sure how to build this project with msbuild. I followed online info @ Microsoft and got this:
error MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/develop
er/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format.
Given that I always build from within the GUI I may need a little coaching on how to do exactly what you need. Note this is a .Net 5.0 project.
I'm not sure how to build this project with msbuild. I followed online info @ Microsoft and got this:
error MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/develop
er/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format.
Given that I always build from within the GUI I may need a little coaching on how to do exactly what you need. Note this is a .Net 5.0 project.
Remco NCrunch Developer
#15534
16 Jul 2021 00:53 UTC
Thanks for sending through the bug report. I can't see a clear reason for this error. The project looks fine. I think the Windows update may have broken something in the underlying toolset.
Can you try the following?
1. Find your version of MSBuild.exe that ships with VS (usually something like C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin)
2. Open a command prompt to the directory containing your project
3. Ensure the bin directory is removed to force a full build
4. Run MSBuild.exe over the project, for example: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" myproject.csproj
Does the project build successfully?
Can you try the following?
1. Find your version of MSBuild.exe that ships with VS (usually something like C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin)
2. Open a command prompt to the directory containing your project
3. Ensure the bin directory is removed to force a full build
4. Run MSBuild.exe over the project, for example: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" myproject.csproj
Does the project build successfully?
Well, the good news or bad news is it does not build. Why would it build via the GUI but not via the command line tool?
The errors are all similar to these:
C:\Development\{Path}\{MorePath}\{ProjectPath}\_Imports.razor(8,27): error CS0234: The type or namespace name 'Shared' does not exist in the namespace '{Project}' (are you missing an assembly reference?) [C:\Development\{Path}\{MorePath}\{Project}\{ProjectName}csproj]
C:\Development\{Path}\{MorePath}\{ProjNameHere}\obj\Debug\net5.0\Razor\Pages\Unsubscribe\Unsubscribe.razor.g.cs(115,33): error CS0115: 'Unsubscribe.BuildRenderTree(RenderTreeBuilder)': no suitable method found to override [C:\Development\{Path}\{MorePath}\{ProjectPath}\{ProjectName}.csproj]
HOWEVER, on the laptop where NCrunch is still working - I get the SAME errors running the MSBuild from the command line. < scratch head />
The errors are all similar to these:
C:\Development\{Path}\{MorePath}\{ProjectPath}\_Imports.razor(8,27): error CS0234: The type or namespace name 'Shared' does not exist in the namespace '{Project}' (are you missing an assembly reference?) [C:\Development\{Path}\{MorePath}\{Project}\{ProjectName}csproj]
C:\Development\{Path}\{MorePath}\{ProjNameHere}\obj\Debug\net5.0\Razor\Pages\Unsubscribe\Unsubscribe.razor.g.cs(115,33): error CS0115: 'Unsubscribe.BuildRenderTree(RenderTreeBuilder)': no suitable method found to override [C:\Development\{Path}\{MorePath}\{ProjectPath}\{ProjectName}.csproj]
HOWEVER, on the laptop where NCrunch is still working - I get the SAME errors running the MSBuild from the command line. < scratch head />
Remco NCrunch Developer
#15540
17 Jul 2021 02:00 UTC
There are some subtle differences in how VS handles the build of projects vs how they are handled by MSBuild. This includes everything from different property values injected into the build to environmental differences in the process doing the work.
NCrunch's build system is more closely aligned with MSBuild than it is with VS. So technically if a project fails to build with MSBuild, it's extremely unlikely that NCrunch will be able to build it.
I note that the errors you're receiving under MSBuild are different to the ones you're getting under NCrunch. I'm hopeful that getting your solution to the point where it can build under MSBuild may well lead to a solution for the NCrunch issue also, but the truth is that there is a lot happening on your system right now that doesn't make sense to me. Given that the issues started appearing after a windows update, it might be worth doing a repair/reinstall of VS to make sure that you don't have a corrupted installation.
NCrunch's build system is more closely aligned with MSBuild than it is with VS. So technically if a project fails to build with MSBuild, it's extremely unlikely that NCrunch will be able to build it.
I note that the errors you're receiving under MSBuild are different to the ones you're getting under NCrunch. I'm hopeful that getting your solution to the point where it can build under MSBuild may well lead to a solution for the NCrunch issue also, but the truth is that there is a lot happening on your system right now that doesn't make sense to me. Given that the issues started appearing after a windows update, it might be worth doing a repair/reinstall of VS to make sure that you don't have a corrupted installation.
Thanks.
I did a repair and it made no difference.
Another developer I work with has the same Windows update, same version of Visual Studio, same version of NCrunch and same project, and it loads without any issues.
Not sure where to go from here.
I did a repair and it made no difference.
Another developer I work with has the same Windows update, same version of Visual Studio, same version of NCrunch and same project, and it loads without any issues.
Not sure where to go from here.
Ok - Totally uninstalled Visual Studio & rebooted.
Clean install of Visual Studio and Repair for NCrunch. Still broken.
Uninstalled NCrunch. Rebooted. Reinstalled NCrunch and it's WORKING :)
I really have no idea what was broken, or exactly what fixed it, but uninstalling both VS and NCrunch and re-installing them both has fixed it.
YAY!
Thanks for your help. I wish I could give you better feedback so you'd know what was wrong, but this is all I have.....
Clean install of Visual Studio and Repair for NCrunch. Still broken.
Uninstalled NCrunch. Rebooted. Reinstalled NCrunch and it's WORKING :)
I really have no idea what was broken, or exactly what fixed it, but uninstalling both VS and NCrunch and re-installing them both has fixed it.
YAY!
Thanks for your help. I wish I could give you better feedback so you'd know what was wrong, but this is all I have.....
Remco NCrunch Developer
#15545
19 Jul 2021 13:30 UTC
DavidPartington wrote:
Uninstalled NCrunch. Rebooted. Reinstalled NCrunch and it's WORKING :)
I really have no idea what was broken, or exactly what fixed it, but uninstalling both VS and NCrunch and re-installing them both has fixed it.
AWESOME!!
DavidPartington wrote:
Thanks for your help. I wish I could give you better feedback so you'd know what was wrong, but this is all I have.....
No matter. If a reinstall fixed it, likely knowing the details wouldn't help much anyway. The answer would simply be to advise a reinstall. That said though, I've never seen this issue be caused by a faulty install of NCrunch before.
I ran into this issue as well and encountered another weird issue that might help others.
When the latest VS2022 preview caused this issue for me I decided to uninstall it completely, and continue using VS2019. However, this ALSO broke NCrunch on VS2019. I rolled back .NET 6 preview 7 to .NET 5 as well, and that continued the issues I was facing
With .NET 6 Preview uninstalled, I ran the `dotnet --version` command and got this response
> Found .NET SDK, but did not find dotnet.dll at [C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\dotnet.dll]
Since I wanted 6 gone, I deleted the 6.0 folder, restarted NCrunch, and it immediately resolved my issue. I am guessing the `dotnet` command will look for the highest version number folder, and the uninstaller must have left the folder behind, resulting in everything breaking.
When the latest VS2022 preview caused this issue for me I decided to uninstall it completely, and continue using VS2019. However, this ALSO broke NCrunch on VS2019. I rolled back .NET 6 preview 7 to .NET 5 as well, and that continued the issues I was facing
With .NET 6 Preview uninstalled, I ran the `dotnet --version` command and got this response
> Found .NET SDK, but did not find dotnet.dll at [C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\dotnet.dll]
Since I wanted 6 gone, I deleted the 6.0 folder, restarted NCrunch, and it immediately resolved my issue. I am guessing the `dotnet` command will look for the highest version number folder, and the uninstaller must have left the folder behind, resulting in everything breaking.
Remco NCrunch Developer
#15602
14 Aug 2021 00:07 UTC
cheil wrote:
Since I wanted 6 gone, I deleted the 6.0 folder, restarted NCrunch, and it immediately resolved my issue. I am guessing the `dotnet` command will look for the highest version number folder, and the uninstaller must have left the folder behind, resulting in everything breaking.
We've had this happen to us in our dev environments here before too. My suspicion is that the uninstaller can leave files behind if they are in use by background processes. There are a number of areas of the toolset where the chosen version of .NET is determined by which directories exist (regardless of whether they happen to be empty).
Good find :)
This could also be fix with DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR & DOTNET_MSBUILD_SDK_RESOLVER_SDKS_VER
Edited 18 Aug 2021 16:56 UTC
I have been getting this error message for a while. I had installed the dotnet6 RC but added local global.json files to the project so they continue to build with dotnet 5 to keep local consistent with the build servers:
I removed dotnet6 as I was only playing with some features - but left the global.json files. Removing the global.sjon files solved the problem
Hopefully this will help someone else - lost hours on this
{
"sdk": { "version": "5.0.302" }
}I removed dotnet6 as I was only playing with some features - but left the global.json files. Removing the global.sjon files solved the problem
Hopefully this will help someone else - lost hours on this
Post a reply
Log in to reply.