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

Notification

Icon
Error

InvalidProjectFileException (a different one)
philAtkin
#1 Posted : Tuesday, September 25, 2012 2:42:57 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/25/2012(UTC)
Posts: 5
Location: Cambridge, UK

Thanks: 1 times
Microsoft.Build.BuildEngine.InvalidProjectFileException: The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild.

Server stack trace:
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, XmlNode xmlNode, String resourceName, Object[] args)
at Microsoft.Build.BuildEngine.Project.InternalLoadFromXmlDocument(XmlDocument projectXml, ProjectLoadSettings projectLoadSettings)
at Microsoft.Build.BuildEngine.Project.LoadXml(String projectXml, ProjectLoadSettings projectLoadSettings)
at nCrunch.VSIntegration2008.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, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

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)

FYI, I have both VS2008 and 2010 on my system. I've installed NCrunch for VS2008. I can't easily convert this project/solution to VS2010 (because it's for a client that only has 2008). Is there a work-round? Any experiment you want me to try?
Remco
#2 Posted : Tuesday, September 25, 2012 9:39:50 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,980

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for posting!

If this project opens and builds for you in the VS2008 IDE, then it looks to me as though this error message may be wrong ... as the stack trace indicates that the build is using the 2008 MSBuild integration.

If the project works only using older versions of Visual Studio (i.e. before 2008), then I'm not sure if there's any way to get this building using NCrunch. NCrunch basically executes the same MSBuild logic as would be used if you were to execute MSBuild using the command line.

Something I'd suggest trying is to run MSBuild.exe directly against the project using the command line. Make sure you use the MSBuild.exe that is under your .NET 3.5 directory (i.e. C:\Windows\Microsoft.NET\Framework64\v3.5). The result from this will help to deduct whether or not the problem is being kicked up directly by MSBuild or by NCrunch's integration.

If you're able to show me any details from the .proj XML, this would also be really helpful as I may be able to reproduce the problem. I'm particularly interested in any tool or framework version declarations in the file.


Cheers,

Remco
philAtkin
#3 Posted : Wednesday, September 26, 2012 11:30:33 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/25/2012(UTC)
Posts: 5
Location: Cambridge, UK

Thanks: 1 times
Hi

I've looked further into this. First, my whole solution builds correctly in the VS2008 IDE.

My solution contains a tester assembly dll written in C# that references a testee assembly written in C++. The specific error message I reported seems to be associated with the C++ assembly; perhaps that's a limitation of NCrunch. I tried to avoid any issue with this assembly by unloading it from the solution, but that made no difference - I guess I'm beginning to understand why. I had to set 'Ignore this component completely' in NCrunch to make progress.

Using MSBuild on the project also showed that the C# build couldn't resolve a 'project' reference to the testee assembly - so I had to make that an explicit path reference.

I also had to fiddle about with the default project _platform_ used for the build. This is because I have both x86 and x64 builds and I cannot use 'Any CPU'. It doesn't help that C++ calls the 32-bit build "Win32" whereas C# uses "x86". It's a pity that, whilst NCrunch allows me to specify which Configuration to build, it doesn't do the same with Platform.

Now, NCrunch has burst into life; I'm looking forward to working with it. Thanks for your help.

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