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

Notification

Icon
Error

NCrunch doesn't work with VS2012 RTM.
khasibhatla
#1 Posted : Friday, September 7, 2012 6:53:20 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/7/2012(UTC)
Posts: 4
Location: Morrisville, NC

I have used the previous versions of NCrunch with VS2012 RC and they seemed have worked fine till recently. I recently upgraded to VS2012 RTM, and also upgraded NCrunch to 1.4*b version. I did not install anything else other than the clean install of NCrunch, however I am still running into the issue below. And, I did install VS2012 package only, not the VS2010 version. Everything else has the default values on them.

Any help/pointers would be great!

Error in the window

System.BadImageFormatException: Could not load file or assembly 'Microsoft.Build.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'Microsoft.Build.dll'

Server stack trace:
at nCrunch.VSIntegration2010.MSBuildIntegration.BuildableProject.Initialise(String buildXml, String snapshotComponentName)
at nCrunch.Compiler.RemoteBuildRunner.#=qNbkQi2Vr17SqPV9algXxiuxDIy822PVS_GqvQLSYots=(String #=qCD9jYvIacrkcP0az5atISw==, String #=qLQBCqSQeyqOQr0tbxk2vEw==, IList`1 #=qGN9oKwJp5oTD2RY_wqfmdg==, String #=qSELCOli$VXlae8TYQugCMg32xGFfC8BZ9CMXH28CdJQ=, String #=qRc9_wbg_8m5wM6rCTXU$0Q==)
at nCrunch.Compiler.RemoteBuildRunner.AnalyseComponentBuild(String projectFilePath, String buildXml, String useBuildConfiguration, String solutionDir, IList`1 importExpressionsToEvaluate)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at nCrunch.Compiler.IRemoteBuildRunner.AnalyseComponentBuild(String projectFilePath, String buildXml, String useBuildConfiguration, String solutionDir, IList`1 importExpressionsToEvaluate)
at nCrunch.Core.BuildManagement.BuildProcessLauncher.#=q7eEMN3clwGL6yDlZ8TdMjhcsrmC7EXOthfVpauxTDm0=.#=q8FmbrzgxnFJTuDLGyA9_e515RUoGSCvIGNvvJnJ0QzWx043eNrNpqJckBkl_levj(IRemoteBuildRunner #=qVgb0RRBCqpdk90fYSTphHo2scSx2FjPoz$psvxJ8P7c=)
at nCrunch.Core.BuildManagement.BuildProcessLauncher.#=qszvdDv$D0z3DOCvNwxO7AlRgboVVZOdlRBn_ngAJubUBJGVqt5fHKWY7P2A227XX(Action`1 #=qHmMDBUhGXzLq$TQxnyJ4qA==)
at nCrunch.Core.BuildManagement.BuildProcessLauncher.AnalyseComponentBuildInExternalProcess(String projectFilePath, String buildXml, String useBuildConfiguration, String solutionDir, IList`1 importExpressionsToEvaluate)
at nCrunch.Core.ComponentLoader.SnapshotComponentFactory.#=qOykwizIZS9PmKxwucmQAdcL_jfkHOIa_J2FiPXces20=()
at nCrunch.Core.ComponentLoader.SnapshotComponentFactory.CreateSnapshotComponentFromXml(String projectFilePath, String projectXml, String solutionFilePath, String[] additionalFilesToIncludeAtSolutionLevel, Boolean isLoadedFromFile)
Remco
#2 Posted : Friday, September 7, 2012 10:14:39 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, thanks for posting!

So far you are the first person to report this issue, which implies that there is something about your environment that is surfacing the issue for you but not others that are running 2012 RTM. I have a sneaky suspicion that the problem may involve the 2012 install without 2010 being present, perhaps it's likely that you have only v4.5 of the .NET framework installed, but not any earlier versions?

Would you be able to check whether you have v2.0, v3.5 and v4.0 of the .NET framework listed inside your installation directory (C:\Windows\Microsoft.NET\Framework)? If any of these are missing, installing them may very well fix the problem. Please let me know if this does the trick, as I'd really like to improve that error message ...


Cheers,

Remco
khasibhatla
#3 Posted : Friday, September 7, 2012 10:58:55 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/7/2012(UTC)
Posts: 4
Location: Morrisville, NC

I have VS 2010 Ultimate also installed on my machine, but did not used NCrunch with VS 2010. I rarely use VS 2010 though, but cannot install that version. Also, when I upgraded to RTM, I did an upgrade from RC, not an uninstall of RC and clean install of RTM. Everything else work's fine - so I don't I need to uninstall VS 2012 and perform a clean install.

Also, I have the following versions of .Net Framework installed in the 'C:\Windows\Microsoft.NET\Framework' directory.
  • 1.0.3705

  • 1.1.4322

  • 2.0.50727

  • 3.0

  • 3.5

  • 4.0.30319


And, the following in 'C:\Windows\Microsoft.NET\Framework64' directory.
  • 2.0.50727

  • 3.0

  • 3.5

  • 4.0.30319


And, NCrunch used to work till August 2nd week, when I upgraded to the latest version. Am I missing anything else here?
Remco
#4 Posted : Saturday, September 8, 2012 12:08:56 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 check the state of your Microsoft.Build.dll file?

I believe this file should normally be under:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0

Can you let me know the version and exact size of the file you have in this location?

... Also ... do you have another Microsoft.Build.dll file under the adjacent v4.5 directory?

If the v4.0 file exists, an interesting test would also be to try building a small test project that references the file, and seeing if it is able to load it within an x86 environment.
khasibhatla
#5 Posted : Saturday, September 8, 2012 12:22:42 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/7/2012(UTC)
Posts: 4
Location: Morrisville, NC

The properties of Microsoft.Build.dll in 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5'
File Version: 4.0.30319.17929
Size: 397 KB
Date Modified: 7/9/2012 12:40 AM

The properties of Microsoft.Build.dll in 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0'
File Version: 4.0.30319.1
Size: 438 KB
Date Modified: 3/18/2010 7:31 PM

How would I ensure NCrunch picks the right version of Build.dll? Is there a setting I should use?
Remco
#6 Posted : Saturday, September 8, 2012 1:02:06 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)
There isn't any logic specifically coded in NCrunch to find and reference this DLL. So far it's been working implicitly, which is always dangerous, as I suppose in the long term this sort of thing can happen. It doesn't look as though this assembly is registered with the GAC, so how it is normally resolved is somewhat of a mystery to me. I'm wondering if you might be interested in trying something a little crazy to see if we can override the resolution logic.

Normally, NCrunch installs itself under your Visual Studio directory, into: \Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2012

Try copying the Microsoft.Build.dll file from your Framework v4.0 diretory into the NCrunch install directory. Hopefully this will give the file higher precedence and allow it to be resolved.

I'm working here at the moment to try and build a test environment with a similar configuration to what you've described. Hopefully soon I'll be able to reproduce the problem.


Cheers,

Remco
khasibhatla
#7 Posted : Saturday, September 8, 2012 1:46:08 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/7/2012(UTC)
Posts: 4
Location: Morrisville, NC

I copied combinations of the the following files from 'Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0' in to '\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2012' directory, and did not get any lucky. NCrunch throws the same error on enabling NCrunch on my solution
* Microsoft.Build.dll
* Microsoft.Build.Engine.dll
* Microsoft.Build.Engine.xml
* Microsoft.Build.Framework.dll
* Microsoft.Build.Framework.xml
* Microsoft.Build.xml
Remco
#8 Posted : Saturday, September 8, 2012 10:58:59 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)
Thanks. I also tried building a test environment in the same manner you've described in order to reproduce the problem, although unfortunately it didn't appear for me.

I'm wondering if you might be interested in trying the following:

1. Create an empty class library, target v4.0 of the .NET framework (in VS2012)
2. Add a reference to NUnit, or another test framework
3. Add an assembly reference to v4 of Microsoft.Build.dll
4. Write a unit test that accesses any type available within Microsoft.Build.dll (even using a typeof(class) is fine)
5. Try running the test using any standard test runner

Does the test work without problems?
pms1969
#9 Posted : Saturday, September 8, 2012 4:14:37 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/8/2012(UTC)
Posts: 6
Location: UK

Was thanked: 3 time(s) in 2 post(s)
Hopefully, I won't be confusing matters any more than usual, but that error usually happens when you mix x86 and x64 code. I've had it before working on an x64 website, that ended up loading a native x86 dll. (it was a tibco dll iirc).

By the way..... Cracking piece of software. Love it.
Remco
#10 Posted : Saturday, September 8, 2012 11:57:22 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 the extra input. I've been thinking about this also, and after a quick review of the code I'm wondering if it may be theoretically possible that NCrunch is loading up its build runners as x64 processes (where they are supposed to be x86).

Khasibhatla, would you mind submitting a bug report after you've experienced the exception in Visual Studio? This will help me to confirm whether this is actually the case ...

Also, which operating system are you using? My understanding of Visual Studio was that it has always been an LAA x86 application. Is your devenv.exe somehow running in x64 bit mode?
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.069 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download