I just started to see the following the other day with one of my projects. The error code seems pretty non-descript. Has anybody else encountered an issue?
NCrunch: If you are experiencing problems in getting this project to build, have a look at https://www.ncrunch.net/documentation/troubleshooting_project-build-issues
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.VisualBasic.targets (154)#1: "Vbc.exe" exited with code -2147191493.
Remco NCrunch Developer
#2335
03 Jul 2012 08:55 UTC
Hi, thanks for posting!
This is the first time I've seen this issue reported, and the error message does appear most unhelpful. Are you making use of any build customisations or 3rd party frameworks that may interface with your build process?
Something that may be worth trying is to attempt to run the NCrunch build manually inside the workspace that NCrunch has built for your project. This will allow you to deductively troubleshoot the issue and find the difference that is causing the problem. Try the following:
1. Run NCrunch so that you see the build failure in the Tests Window
2. Right-click on the failed build, choose 'Advanced->Browse to workspace'
3. Open a command prompt at the location shown in the explorer window, and go to the directory containing the .vbproj file
4. Execute msbuild.exe against the project file in your command prompt.
You can find the msbuild.exe file under your framework install path (i.e. C:\Windows\Microsoft.NET\Framework\v4.0.30319)
It's also worth inspecting the workspace to make sure it contains all the files you would expect it to. The workspace is supposed to be identical in build functionality to your original project directory, the part that isn't identical is probably the cause of this problem.
This is the first time I've seen this issue reported, and the error message does appear most unhelpful. Are you making use of any build customisations or 3rd party frameworks that may interface with your build process?
Something that may be worth trying is to attempt to run the NCrunch build manually inside the workspace that NCrunch has built for your project. This will allow you to deductively troubleshoot the issue and find the difference that is causing the problem. Try the following:
1. Run NCrunch so that you see the build failure in the Tests Window
2. Right-click on the failed build, choose 'Advanced->Browse to workspace'
3. Open a command prompt at the location shown in the explorer window, and go to the directory containing the .vbproj file
4. Execute msbuild.exe against the project file in your command prompt.
You can find the msbuild.exe file under your framework install path (i.e. C:\Windows\Microsoft.NET\Framework\v4.0.30319)
It's also worth inspecting the workspace to make sure it contains all the files you would expect it to. The workspace is supposed to be identical in build functionality to your original project directory, the part that isn't identical is probably the cause of this problem.
Edited 03 Jul 2012 08:57 UTC
The error still persists. The only noticeable difference is in the .vbproj.filelistabsolute.txt file. The folders containing the code are identical.
Remco NCrunch Developer
#2350
04 Jul 2012 00:11 UTC
What happens if you try running MSBuild.exe directly against the project as it exists in its original project directory? (i.e. outside the workspace). Do you receive the error when you do this?
Is this a project that you're able to share in any capacity? I can probably be of much more help if I'm able to try working with the source code.
Otherwise, try editing the .vbproj file inside the workspace, deductively removing parts of the XML (without causing different compilation errors if possible) until the compiler runs without an error. This may give us some clue as to why the compiler is behaving like this.
Is this a project that you're able to share in any capacity? I can probably be of much more help if I'm able to try working with the source code.
Otherwise, try editing the .vbproj file inside the workspace, deductively removing parts of the XML (without causing different compilation errors if possible) until the compiler runs without an error. This may give us some clue as to why the compiler is behaving like this.
If I run msbuild directly in builds fine, same thing with through Visual Studio.
I'm unable to share the code with you, the company I work for does not permit it.
I've tried pulling things out of the .vbproj file and I can tell you if I scrape all of my actual code files out of it msbuild will run. For me what is confusing is why msbuild directly on the project works, but not on the ncrunch versions.
I'm unable to share the code with you, the company I work for does not permit it.
I've tried pulling things out of the .vbproj file and I can tell you if I scrape all of my actual code files out of it msbuild will run. For me what is confusing is why msbuild directly on the project works, but not on the ncrunch versions.
Remco NCrunch Developer
#2382
09 Jul 2012 02:04 UTC
Are you making use of any assembly-level attributes as part of your project? To a key-file or so perhaps?
No. Nothing like that at all.
Remco NCrunch Developer
#2476
18 Jul 2012 04:35 UTC
Something else to try... For all of the projects in your solution (use multi-select in the tree list if this makes things easier):
Turn OFF the 'Include static references in workspace' option
Turn OFF 'Instrument output assembly'
Turn ON the 'Copy referenced assemblies to workspace' option
Turn ON the 'Run post-build events' and 'Run pre-build events' options
Turn ON 'Allow static code contract checking'
.. Make sure you reset NCrunch after adjusting all these options. The goal of these adjustments is to make the NCrunch build operate as identically as possible to the normal VS build process, so if this does work you'll lose quite a bit of optimisation (but we'll then have more information to work from).
Does this make any difference?
Turn OFF the 'Include static references in workspace' option
Turn OFF 'Instrument output assembly'
Turn ON the 'Copy referenced assemblies to workspace' option
Turn ON the 'Run post-build events' and 'Run pre-build events' options
Turn ON 'Allow static code contract checking'
.. Make sure you reset NCrunch after adjusting all these options. The goal of these adjustments is to make the NCrunch build operate as identically as possible to the normal VS build process, so if this does work you'll lose quite a bit of optimisation (but we'll then have more information to work from).
Does this make any difference?
Doing that does seem to have worked, although the performance suffers greatly. Afterwards I went through and toggled the switches one at a time, then putting them back to see if I could find the offending switch and it fails until I set "instrument output assembly" to False. I tried doing this on the individual offending project and not the others and it still fails, so in order to have NCrunch run I have need that set on more than one of my projects.
Remco NCrunch Developer
#2481
19 Jul 2012 06:23 UTC
In order for NCrunch to really work correctly (with all its features), 'Instrument output assembly' should be set to 'True'. NCrunch uses the instrumentation in order to perform code coverage analysis, so you'll notice that the coverage markers don't appear if you have it turned off throughout your solution.
If turning this setting off is making the error disappear for you, then likely it's related to one of the referenced projects of the one that is failing. Try toying with the setting for each of the project references until you can find which one is causing it - we can then try and narrow down to see what is special about this project that makes the VB compiler fail.
If turning this setting off is making the error disappear for you, then likely it's related to one of the referenced projects of the one that is failing. Try toying with the setting for each of the project references until you can find which one is causing it - we can then try and narrow down to see what is special about this project that makes the VB compiler fail.
Okay, I did what you suggested and I've narrowed it down to a specific project which is awesome news. I'm seeing code coverage indicators in my other projects now.
Remco NCrunch Developer
#2485
20 Jul 2012 01:45 UTC
Nice work! Is there anything about this project that could be considered unusual compared with the others? For example, a different .NET framework version, perhaps some particularly low-level or structurally complex source code ...
Nothing I can see. The really strange thing is that this project is referenced by others that NCrunch builds just fine.
Remco NCrunch Developer
#2491
20 Jul 2012 22:30 UTC
It must be caused by a certain piece of code that the project surfaces and is referenced from the project that is failing. Is there any part of the project that is consumed by the failing project and appears to be structurally/syntactically complex? For example, a generic multidimensional array, or generic of generic, etc.
Post a reply
Log in to reply.