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

Notification

Icon
Error

Build Fails: Single-threaded Apartment
CoolBreeze
#1 Posted : Friday, March 27, 2015 5:09:46 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 7/11/2014(UTC)
Posts: 79
Location: United States of America

Was thanked: 9 time(s) in 9 post(s)
Build fails with:

NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ng_project-build-issues
vbc (0): warning number '42353' for the option 'nowarn' is either not configurable or not valid
vbc (0): warning number '42354' for the option 'nowarn' is either not configurable or not valid
vbc (0): warning number '42355' for the option 'nowarn' is either not configurable or not valid


WARNING - The MSBuild engine must be called on a single-threaded-apartment. Current threading model is "MTA". Proceeding, but some tasks may not function correctly.


I did go to the build issues page but unless I overlooked it I didn't see anything about MTA vs STA.

I looked at the Configuration to see if there were an option to change from MTA to STA.


Visual Studio 2008
NCrunch 2.13.0.5

Thanks, Ed
Remco
#2 Posted : Friday, March 27, 2015 10:42:01 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Ed,

This is a very, very old issue. To my knowledge, it only affects VS2008 and I've had no reports of this warning having any teeth.

Are you using 'Warnings as errors' in your build settings?
CoolBreeze
#3 Posted : Monday, March 30, 2015 2:36:32 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 7/11/2014(UTC)
Posts: 79
Location: United States of America

Was thanked: 9 time(s) in 9 post(s)
Hi Remco,

Thanks for the suggestion.

I confirmed that the project has Treat Warnings as Errors unchecked.

I did have one project that was failing to build (after I enabled NCrunch). I unloaded that project.

In VS 2008 I did a Clean Solution and Rebuild Solution. The build is successful.

I'm wondering if I should upgrade the solution to VS2010 and then try NCrunch and remember to make sure the project targets ASP.NET 2.0). I've successfully run NCrunch in another VS 2010 solution so maybe that's the way to go.

Thanks, Ed
CoolBreeze
#4 Posted : Monday, March 30, 2015 4:48:33 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 7/11/2014(UTC)
Posts: 79
Location: United States of America

Was thanked: 9 time(s) in 9 post(s)
Hi Remco,

Here's my progress.

I upgraded the solution from VS 2008 to VS 2010.
NCrunch successfully built the project.
I was able to successfully run a single test.
I built the Setup project.
I successfully installed the project on my box Windows 7 Pro.
I tried to install the app on Server 2000 and it failed.
(It's on the discussion list to upgrade the server to a newer version of Windows Server but that's probably several months away.)

I downgraded the project to VS 2008.
When I restarted NCrunch failed to build the project.

I opened a command prompt and ran MSBUILD.
It looked like a pre-build event was failing to copy a file due to access permissions.
I disabled that event.
Also, the build appeared to fail due to project files being checked into Visual Source Safe.
I checked out all project files.
I successfully built the project using MSBuild in the latest NCrunch workspace.
NCrunch however still claims the project is failing to build.

Any more suggestions?

Thanks, Ed


CoolBreeze
#5 Posted : Monday, March 30, 2015 5:05:32 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 7/11/2014(UTC)
Posts: 79
Location: United States of America

Was thanked: 9 time(s) in 9 post(s)
Hi Remco,

I solved the problem.

These warnings were causing the problem.

vbc(0,0): error BC2026: warning number '42353' for the option 'nowarn' is either not configurable or not valid
vbc(0,0): error BC2026: warning number '42354' for the option 'nowarn' is either not configurable or not valid
vbc(0,0): error BC2026: warning number '42355' for the option 'nowarn' is either not configurable or not valid

As best as I can tell when I did the upgrade to VS2010 the conversion tool added the warning numbers to the vbproj file.

I removed the numbers 42353, 42354, 42355 from this line in the main project and tests project vbproj files:

<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>

Then the main and test projects successfully built and I was able to run tests.


Ed
Remco
#6 Posted : Monday, March 30, 2015 10:28:25 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Ed,

I did think about this afterwards and wondered if the build error was related to the warnings. It doesn't make sense to me why VS would be able to build such a project without giving a similar complaint, though I'm glad you managed to find and resolve the problem.

I do also recommend upgrading to VS2010 or above if this is at all an option for you. Not all of NCrunch's features will work in VS2008, and you will get a much better experience in later versions.


Cheers,

Remco
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.039 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download