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

Notification

Icon
Error

System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
jjvdgeer
#1 Posted : Monday, October 2, 2017 7:40:58 PM(UTC)
Rank: Member

Groups: Registered
Joined: 10/2/2017(UTC)
Posts: 16
Location: Norway

Was thanked: 1 time(s) in 1 post(s)
On my home machine I just installed the Console Tool which runs the tests in our build system. At work I use the same setup and it works fine there. However here on this machine it fails:

Launched command : cmd.exe /X /C ""C:\Program Files (x86)\Remco Software\NCrunch Console Tool\NCrunch.exe" C:\src\Classic-AMIS\trunk\Classic-AMIS-Internal\Classic-AMIS-Internal.2015.sln /O C:\src\Classic-AMIS\trunk\Classic-AMIS-Internal\target\Results"

NCrunch Console Tool v3.11.0.9
Copyright ¸ 2010-2017 Remco Software Ltd
Usage of this tool is permitted only under the terms described in License.rtf



This product is licensed to ********* (support/maintenance expires 29-Sep-2018)

[21:24:38.3817-?-1] Initialising UI Services
[21:24:38.4328-?-1] NCrunch Services Initialised
[21:24:38.4833-?-1] Publishing Event: [EngineModeSwitchedInUIEvent:Run all tests automatically [Global]]
[21:24:38.4848-?-1] Event [EngineModeSwitchedInUIEvent:Run all tests automatically [Global]] is being published on thread CoreThread to subscriber: ClientSettingsBlock.
[21:24:38.4918-?-1] Publishing Event: [EngineModesChangedEvent]
[21:24:38.4953-Core-4] Event [EngineModeSwitchedInUIEvent:Run all tests automatically [Global]] is being processed on Core thread with subscriber: ClientSettingsBlock.
[21:24:39.0092-Core-7] Loading NCrunch modules
[21:24:39.0132-Core-7] Loading module: C:\Program Files (x86)\Remco Software\NCrunch Console Tool\Modules\Gallio\nCrunch.Module.Gallio.crunchmodule
[21:24:39.0207-Core-7] Loading module: C:\Program Files (x86)\Remco Software\NCrunch Console Tool\Modules\MSpec\nCrunch.Module.MSpec.crunchmodule
[21:24:39.0232-Core-7] Loading module: C:\Program Files (x86)\Remco Software\NCrunch Console Tool\Modules\MSTest\nCrunch.Module.MSTest.crunchmodule
[21:24:39.0247-Core-7] Loading module: C:\Program Files (x86)\Remco Software\NCrunch Console Tool\Modules\NUnit\nCrunch.Module.NUnit.crunchmodule
[21:24:39.0272-Core-7] Loading module: C:\Program Files (x86)\Remco Software\NCrunch Console Tool\Modules\NUnit3\nCrunch.Module.NUnit3.crunchmodule
[21:24:39.0312-Core-7] Loading module: C:\Program Files (x86)\Remco Software\NCrunch Console Tool\Modules\XUnit2\nCrunch.Module.XUnit2.crunchmodule
[21:24:40.5883-Core-7] Framework description manager has loaded data for 6 test frameworks
[21:24:40.6559-InitialisationQueueTask-16] Auto restoring NuGet packages for 'C:\src\Classic-AMIS\trunk\Classic-AMIS-Internal\Classic.AMIS.Internal.Schema.UnitTests\Classic.AMIS.Internal.Schema.UnitTests.csproj'
[21:24:40.6559-InitialisationQueueTask-14] Auto restoring NuGet packages for 'C:\src\Classic-AMIS\trunk\Classic-AMIS-Internal\Classic.AMIS.Internal.DemoClient\Classic.AMIS.Internal.DemoClient.csproj'
[21:24:40.6559-InitialisationQueueTask-15] Auto restoring NuGet packages for 'C:\src\Classic-AMIS\trunk\Classic-AMIS-Internal\Classic.AMIS.Internal.Schema\Classic.AMIS.Internal.Schema.csproj'
[21:24:40.6569-InitialisationQueueTask-18] Auto restoring NuGet packages for 'C:\src\Classic-AMIS\trunk\Classic-AMIS-Internal\Classic.AMIS.Internal.Service\Classic.AMIS.Internal.Service.csproj'
[21:24:40.6639-InitialisationQueueTask-16] ERROR (Internal): System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at nCrunch.Core.PlatformTypes.DotNetCoreSdk.TryRestoreReturningFailure(FilePath projectFilePath, VisualStudioVersion vsVersion)
at nCrunch.Client.ComponentLoader.AutoNugetRestoreMode.RestorePackages(FilePath projectFilePath, VisualStudioVersion vsVersion)
at nCrunch.Client.ComponentLoader.SnapshotComponentFactory.CreateComponentsFromXml(FilePath projectFilePath, BuildXml projectXml, FilePath solutionFilePath, String[] additionalFilesToIncludeAtSolutionLevel, Boolean isLoadedFromFile, VisualStudioVersion vsVersion)
at nCrunch.Client.Initialisation.ProjectLoadInitTask.Run()

Any idea what is wrong? I tried repairing and reinstalling the Console Tool and restarting the machine but that did not help.

The C:\Program Files (x86)\Remco Software\NCrunch Console Tool directory contains the nCrunch.TaskRunner*.x*.exe files which I saw in another forum topic might be missing. Dunno if I have all of them, but it looks pretty complete, I've got 18 of them.
jjvdgeer
#2 Posted : Monday, October 2, 2017 8:01:54 PM(UTC)
Rank: Member

Groups: Registered
Joined: 10/2/2017(UTC)
Posts: 16
Location: Norway

Was thanked: 1 time(s) in 1 post(s)
Hm, I think I resolved my issue. Seems all I had to do was remove the _NCrunch directory... Some issue with upgrading from 2.19?
jjvdgeer
#3 Posted : Monday, October 2, 2017 8:24:58 PM(UTC)
Rank: Member

Groups: Registered
Joined: 10/2/2017(UTC)
Posts: 16
Location: Norway

Was thanked: 1 time(s) in 1 post(s)
Hm, it seems there's more to it than that. When I have the solution open in Visual Studio, it fails with the above error. Also when I delete the _NCrunch directory and NCrunch disabled.

But when I close VS and then delete the _NCrunch directory and then build it works fine.

Unsure what is happening...
Remco
#4 Posted : Monday, October 2, 2017 10:34:23 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Hi,

It looks like you're using a CPS based project and you don't have the .NET Core SDK installed.

Are you able to open these projects in Visual Studio? Do they build on this machine?
jjvdgeer
#5 Posted : Tuesday, October 3, 2017 6:47:12 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/2/2017(UTC)
Posts: 16
Location: Norway

Was thanked: 1 time(s) in 1 post(s)
CPS is something to do with .NET Core? I don't think that's relevant here than.

We're talking about a normal VS2015 project targeting .NET 4.6.1 (though some projects still target 4.0). I now got the same problem at my work machine, so it's obviously not restricted to my home machine.

I have the Microsoft .NET Framework 4.6.2 SDK installed (as well as 4.6.1, 5.6, 4.5.1 and 4.5).

The projects open fine in VS2015 and build as well on both machines.
Remco
#6 Posted : Tuesday, October 3, 2017 8:07:42 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
For some reason, NCrunch thinks that the project 'C:\src\Classic-AMIS\trunk\Classic-AMIS-Internal\Classic.AMIS.Internal.Schema.UnitTests\Classic.AMIS.Internal.Schema.UnitTests.csproj' has a TargetFramework of netcoreapp or netstandard. Because of this, it's trying to find MSBuild.exe under the VS install path, which doesn't exist under VS2015.

Which framework does this project target? Was it built using one of the standard VS project templates?
jjvdgeer
#7 Posted : Tuesday, October 3, 2017 8:53:51 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/2/2017(UTC)
Posts: 16
Location: Norway

Was thanked: 1 time(s) in 1 post(s)
It targets the .NET 4.0 framework.

This is how the csproj file looks like: https://pastebin.com/dEi0KT9k
Remco
#8 Posted : Tuesday, October 3, 2017 9:58:20 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Would you be able to get me a detailed trace log from the console tool?

You can do this by passing "-LogVerbosity Detailed" on the command line, and redirecting the output to a text file. If it's too much to paste here, you can submit it through the contact form.
jjvdgeer
#9 Posted : Tuesday, October 3, 2017 10:56:07 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/2/2017(UTC)
Posts: 16
Location: Norway

Was thanked: 1 time(s) in 1 post(s)
Done
Remco
#10 Posted : Tuesday, October 3, 2017 11:52:05 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Thanks for sending through the log.

So we have two problems here. One is the failed Auto restore of NuGet packages by the console tool. The second looks to be caused by corrupt cache data.

To solve the first problem: When you run the console tool, make sure you specify that you want to use VS2015 as such: ncrunch.exe c:\projects\mysolution.sln /vs 2015

To solve the second problem: Try deleting the contents of the _NCrunch_* directory adjacent to the solution file. Something in the cache has gotten into a twist, so we need to clear it out to let the tool run again.
jjvdgeer
#11 Posted : Wednesday, October 4, 2017 4:58:42 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/2/2017(UTC)
Posts: 16
Location: Norway

Was thanked: 1 time(s) in 1 post(s)
The nugget problem is not really a problem as we're using maven and as a consequence convert all needed nugget packages to maven packages.

The corruption problem is more relevant though. I'm not really sure how easy it will be to ensure the cache is emptied through the maven build process. Not a maven guru.. Have to look into that.

Is this a bug that will be fixed in a future version? We could go back to the previous version we used, 2.19, for a while although that means we cannot build for. NET 4.6.2 anymore. Or are there versions that do not suffer from this problem but still support. NET 4.6.2?

As an alternative, could we add something to the command to steer where the _NCrunch_* directory is placed? If we can place it in the Result directory it would be cleared by maven. Sorry, am on a telephone right now, so I can't take a quick look in the command parameters provided.
Remco
#12 Posted : Wednesday, October 4, 2017 5:01:00 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
I think the cache corruption issue is a once off. I'm not sure why this has happened to you. Others have reported cache corruption problems on the later versions of NCrunch, but I've yet to encounter a use case that can consistently produce them in a way that allows me to fix them.

Did removing the cache file permanently resolve the problem for you? Or did it come back shortly after?
jjvdgeer
#13 Posted : Wednesday, October 4, 2017 5:57:10 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/2/2017(UTC)
Posts: 16
Location: Norway

Was thanked: 1 time(s) in 1 post(s)
It comes back all the time. It most certainly is not a one off. However I'm not really sure what is involved, but it seems to be related to using the solution both from Visual Studio and running the Console Tool on the same directory. But I think that's not the whole story. There is a solution that seems to be failing all the time on the build server, and it seems to be the same problem. Of course, on the build server VS is not involved. Yesterday I removed the _NCrunch directory but the problem remained. Thankfully that's not an important solution so we can live with that for a while.
Remco
#14 Posted : Wednesday, October 4, 2017 7:51:45 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Looking at the code involved here, I'm having a hard time understanding how this issue could exist, unless it were a downstream issue from something else going horribly wrong.

I'm eager to learn more about this problem in the hope of reproducing it. Are you able to uncover any steps that consistently create it?
jjvdgeer
#15 Posted : Wednesday, October 4, 2017 7:08:51 PM(UTC)
Rank: Member

Groups: Registered
Joined: 10/2/2017(UTC)
Posts: 16
Location: Norway

Was thanked: 1 time(s) in 1 post(s)
I haven't looked close at the problem at the buildserver but for now I'm assuming it is unrelated. Deleting the _NCrunch directory there and rebuilding did not fix it, but there were more pressing matters, so I had to leave it for now.

However, I think I have a sequence that reproduces the problem.

Our build process is invoked with the command "mvn install". When I delete the _NCrunch directory and run "mvn install" all is well. I seem to be able to run it repeatedly without problems. The "mvn install" at some point does a:

"C:\Program Files (x86)\Remco Software\NCrunch Console Tool\NCrunch.exe" C:\src\Classic-AMIS\trunk\Classic-AMIS-Internal\Classic-AMIS-Internal.2015.sln /O C:\src\Classic-AMIS\trunk\Classic-AMIS-Internal\target\Results

Issueing this as well in the command line works fine. Also if I do this multiple times.

However, usually I build using an external tool in VS. So if you go too VS->Tools->External tools... there is an entry for "mvn install". For testing purposes I also added an external tool for the ncrunch command. So I defined the following properties:

Title: NCrunch
Command: C:\Program Files (x86)\Remco Software\NCrunch Console Tool\NCrunch.exe
Arguments: $(SolutionFileName) /O $(SolutionDir)\target\Results
Use Output window: ticked
Treat output as Unicode: unticked
Prompt for arguments: unticked
Close on exit: disabled and ticked

This should generate an external command which should be equivalent to the one just issued in the command prompt.

When I choose this commad, VS->Tools->NCrunch, the command will fail with some NREs.

If I after this run the NCrunch command again, it fails, it has become corrupted.
Remco
#16 Posted : Wednesday, October 4, 2017 9:34:13 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
jjvdgeer;11315 wrote:

When I choose this commad, VS->Tools->NCrunch, the command will fail with some NREs.

If I after this run the NCrunch command again, it fails, it has become corrupted.


Is there any chance you can share with me a trace log from NCrunch that shows this initial set of NREs? The NREs I've examined so far seem to be downstream from these, so I think they may be the true problem here. It shouldn't be possible for NCrunch to corrupt its cache files in this way.
jjvdgeer
#17 Posted : Wednesday, October 4, 2017 9:47:39 PM(UTC)
Rank: Member

Groups: Registered
Joined: 10/2/2017(UTC)
Posts: 16
Location: Norway

Was thanked: 1 time(s) in 1 post(s)
I just sent the trace log through the same contact form as before.
Remco
#18 Posted : Wednesday, October 4, 2017 11:26:19 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Thanks for sending this through. This is a really good report as it explains some very strange things I've been seeing these last few months.

It looks as though when there is an unexpected problem that appears during project load, the project gets pulled up by the engine in a half-initialised state. This causes serious downstream chaos resulting in cache corruption. The root of the problem in this case is that the /VS 2015 switch isn't present on the command-line call to ncrunch.exe, so NCrunch is trying to build the VS2015 projects using VS2017 logic and it's exploding.

If I understand all this correctly, making sure that you provide /VS 2015 on the command line and clearing the .cache file should result in a permanent solution to this problem for you.

I can advise that I'm also introducing the following changes into the upcoming v3.12 release:
- NCrunch will no longer try to restore packages (since it does this too slowly and most people do it in their build system anyway)
- Error handling will be revised to prevent downstream corruption
jjvdgeer
#19 Posted : Thursday, October 5, 2017 7:38:16 PM(UTC)
Rank: Member

Groups: Registered
Joined: 10/2/2017(UTC)
Posts: 16
Location: Norway

Was thanked: 1 time(s) in 1 post(s)
So I should have taken your first advice about /VS 2015, then my problem would have gone away... :) Well, doing so now and it works fine now. Glad you found the problem!

Thanks!
1 user thanked jjvdgeer for this useful post.
Remco on 10/5/2017(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.097 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download