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

Notification

Icon
Error

vbc.exe issue on build
bteller
#1 Posted : Monday, July 2, 2012 2:34:53 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/2/2012(UTC)
Posts: 7

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/...ng_project-build-issues
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.VisualBasic.targets (154)#1: "Vbc.exe" exited with code -2147191493.
Remco
#2 Posted : Tuesday, July 3, 2012 8:55:13 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
bteller
#3 Posted : Tuesday, July 3, 2012 12:06:19 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/2/2012(UTC)
Posts: 7

The error still persists. The only noticeable difference is in the .vbproj.filelistabsolute.txt file. The folders containing the code are identical.
Remco
#4 Posted : Wednesday, July 4, 2012 12:11:04 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
bteller
#5 Posted : Saturday, July 7, 2012 3:21:25 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/2/2012(UTC)
Posts: 7

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.
Remco
#6 Posted : Monday, July 9, 2012 2:04:20 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Are you making use of any assembly-level attributes as part of your project? To a key-file or so perhaps?
bteller
#7 Posted : Tuesday, July 17, 2012 7:35:34 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/2/2012(UTC)
Posts: 7

No. Nothing like that at all.
Remco
#8 Posted : Wednesday, July 18, 2012 4:35:34 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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?
bteller
#9 Posted : Wednesday, July 18, 2012 6:58:33 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/2/2012(UTC)
Posts: 7

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
#10 Posted : Thursday, July 19, 2012 6:23:25 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
bteller
#11 Posted : Thursday, July 19, 2012 2:06:20 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/2/2012(UTC)
Posts: 7

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
#12 Posted : Friday, July 20, 2012 1:45:11 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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 ...
bteller
#13 Posted : Friday, July 20, 2012 6:08:22 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/2/2012(UTC)
Posts: 7

Nothing I can see. The really strange thing is that this project is referenced by others that NCrunch builds just fine.
Remco
#14 Posted : Friday, July 20, 2012 10:30:10 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
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.150 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download