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

Notification

Icon
Error

2 Pages12>
System.InvalidProgramException: Common Language Runtime detected an invalid program
ylee
#1 Posted : Thursday, March 8, 2012 2:37:49 PM(UTC)
Rank: Member

Groups: Registered
Joined: 2/15/2012(UTC)
Posts: 20

Thanks: 6 times
Was thanked: 3 time(s) in 3 post(s)
NCrunch 1.38.0.17b,
Visual Studio 2010
Windows 7 64bit

Steps to reproduce the issue (VS 11 beta + NCrunch 1.38.0.18b don't have this issue):

1. Open VS 2010;
2. File > New > Project, choose Installed Templates > Visual C# > Test Project, to create a new test project;
3. NCrunch > Enable NCrunch, use default settings in the Configuration Wizard;
4. NCrunch > Tests, I get the following exception in the NCrunch Tests window:

System.InvalidProgramException: Common Language Runtime detected an invalid program.

Server stack trace:
at System.Uri.ParseScheme(String uriString, Flags& flags, UriParser& syntax)
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString)
at nCrunch.Common.AppDomainHelper.GetLocationOnDisk(Assembly assembly)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitTestFramework.GetDescription()
at nCrunch.TestExecution.Frameworks.TestFrameworkRegistry.GetDescriptionForEachFramework()
at nCrunch.TestExecution.Frameworks.FrameworkDescriptionResolver.GetDescriptionForEachFramework()
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.TestExecution.Frameworks.IFrameworkDescriptionResolver.GetDescriptionForEachFramework()
at nCrunch.Core.TestManagement.TestFrameworkDescriptionManager.EnsureDescriptionsAreLoaded()
at nCrunch.Core.ComponentLoader.SnapshotComponentFactory.CreateSnapshotComponentFromXml(String projectFilePath, String projectXml, String solutionFilePath, String[] additionalFilesToIncludeAtSolutionLevel, Boolean isLoadedFromFile)

Remco
#2 Posted : Thursday, March 8, 2012 6:32:56 PM(UTC)
Rank: NCrunch Developer

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

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

Thanks for reporting this. I'm wondering if this could be related to the other issue you've reported on this forum. Do you have a 64-bit version of NUnit installed in your GAC?
ylee
#3 Posted : Thursday, March 8, 2012 6:52:06 PM(UTC)
Rank: Member

Groups: Registered
Joined: 2/15/2012(UTC)
Posts: 20

Thanks: 6 times
Was thanked: 3 time(s) in 3 post(s)
Remco;1363 wrote:
Do you have a 64-bit version of NUnit installed in your GAC?

Yes. I've just uninstalled NUnit from GAC, but I still got the same errors.

Update: I reinstalled NCrunch after removing NUnit from GAC, but still got the same errors.
Remco
#4 Posted : Thursday, March 8, 2012 6:59:04 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Ok - can you check the following?

- That you don't also have a 64 bit version of NUnit.Core in your GAC (consider running the NUnit uninstaller)
- That you don't have any references to NUnit.Core throughout your codebase (often people set these up by accident mistaking NUnit.Core for NUnit.Framework)
- That the version of NUnit.Framework referenced from all projects in your solution has not be compiled specifically for 64-bit. If you want to be certain of this, try grabbing the NUnit.Framework.dll file from "Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2010" and using this as your NUnit reference.
ylee
#5 Posted : Thursday, March 8, 2012 7:08:29 PM(UTC)
Rank: Member

Groups: Registered
Joined: 2/15/2012(UTC)
Posts: 20

Thanks: 6 times
Was thanked: 3 time(s) in 3 post(s)
Quote:
- That you don't also have a 64 bit version of NUnit.Core in your GAC (consider running the NUnit uninstaller)

Yes. I uninstalled NUnit using its uninstaller. I checked C:\Windows\assembly, there is no NUnit assemblies there.

Quote:
- That you don't have any references to NUnit.Core throughout your codebase (often people set these up by accident mistaking NUnit.Core for NUnit.Framework)
- That the version of NUnit.Framework referenced from all projects in your solution has not be compiled specifically for 64-bit. If you want to be certain of this, try grabbing the NUnit.Framework.dll file from "Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2010" and using this as your NUnit reference.

The test solution don't have any reference to NUnit, it has only references to:
* Microsoft.VisualStudio.QualityTools.UnitTestFramework
* System
* System.Core

But I still got the same errors.
Remco
#6 Posted : Thursday, March 8, 2012 7:39:32 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Are there many situations where you've managed to get past this problem? I'm thinking in reference to the other thread on this forum where you've mentioned this same exception bubbling up from the test runner itself.

Also - which version of TypeMock Isolator are you using?
ylee
#7 Posted : Thursday, March 8, 2012 7:51:00 PM(UTC)
Rank: Member

Groups: Registered
Joined: 2/15/2012(UTC)
Posts: 20

Thanks: 6 times
Was thanked: 3 time(s) in 3 post(s)
Remco;1375 wrote:
Are there many situations where you've managed to get past this problem? I'm thinking in reference to the other thread on this forum where you've mentioned this same exception bubbling up from the test runner itself.

Also - which version of TypeMock Isolator are you using?

I'm using Typemock Isolator 6.2.

The issue in this thread only happens in VS 2010, VS 11 beta doesn't have this issue (I've posted my system configurations in my first post).

I'm trying to find workaround to this issue, but so far no luck.
ylee
#8 Posted : Thursday, March 8, 2012 8:05:51 PM(UTC)
Rank: Member

Groups: Registered
Joined: 2/15/2012(UTC)
Posts: 20

Thanks: 6 times
Was thanked: 3 time(s) in 3 post(s)
OK, to fixed the issue in this thread, I only need to disable Typemock, then re-enabled it in VS 2010 (I only need to do this once, and it fixed all solutions).

And the issue in the other thread can be workaround by removing references to Typemock assemblies.

So both issues are related to Typemock Isolator.
Remco
#9 Posted : Thursday, March 8, 2012 8:09:34 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Ok thanks - I'll raise the issue with the TypeMock guys to see if we can work out a proper solution.
atali
#10 Posted : Saturday, March 10, 2012 12:00:52 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/9/2012(UTC)
Posts: 4

Was thanked: 2 time(s) in 1 post(s)
Since, I have installed vs11 , I am unable to run my tests. I have the following exception :

System.InvalidProgramException: Common Language Runtime detected an invalid program.

Server stack trace:
at System.Uri.ParseScheme(String uriString, Flags& flags, UriParser& syntax)
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString)
at nCrunch.Common.AppDomainHelper.GetLocationOnDisk(Assembly assembly)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitTestFramework.GetDescription()
at nCrunch.TestExecution.Frameworks.TestFrameworkRegistry.GetDescriptionForEachFramework()
at nCrunch.TestExecution.Frameworks.FrameworkDescriptionResolver.GetDescriptionForEachFramework()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

I disabled and reenabled it from vs2010 but without any success.

Remco
#11 Posted : Sunday, March 11, 2012 8:53:12 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks - I'm coordinating with the TypeMock team at the moment to find a proper solution to the above issue. I'll keep you informed.
atali
#12 Posted : Sunday, March 11, 2012 9:15:12 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/9/2012(UTC)
Posts: 4

Was thanked: 2 time(s) in 1 post(s)
I also opened a case 3389. thanks
Remco
#13 Posted : Monday, March 12, 2012 9:26:43 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
I've had a response from TypeMock support. It seems like this was an NCrunch/Isolator integration issue that surfaced with the release of Isolator 7. A fix has been implemented in the latest revision of Isolator 7, so hopefully updating your version of Isolator will solve this problem. Please let me know how this goes!

Cheers,

Remco
atali
#14 Posted : Monday, March 12, 2012 9:29:04 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/9/2012(UTC)
Posts: 4

Was thanked: 2 time(s) in 1 post(s)
Hello Remco,

I upgraded to Typemock 7 but with no success. :-(

Best regards,
ylee
#15 Posted : Tuesday, March 13, 2012 12:35:19 AM(UTC)
Rank: Member

Groups: Registered
Joined: 2/15/2012(UTC)
Posts: 20

Thanks: 6 times
Was thanked: 3 time(s) in 3 post(s)
I've upgraded to Isolator v7, but also no success.

I got slightly different errors in the Processing Queue:

[08:28:16.079-TestExecutionTask-100] ERROR (Internal): System.InvalidProgramException: Common Language Runtime detected an invalid program.
at System.Uri.NotAny(Flags flags)
at System.Uri.PrivateParseMinimal()
at System.Uri.InitializeUri(ParsingError err, UriKind uriKind, UriFormatException& e)
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString)
at NUnit.Core.AssemblyHelper.GetAssemblyPath(Assembly assembly)
at NUnit.Core.AssemblyHelper.GetDirectoryName(Assembly assembly)
at NUnit.Core.TestFixture.Run(EventListener listener, ITestFilter filter)
at NUnit.Core.TestSuite.RunAllTests(TestResult suiteResult, EventListener listener, ITestFilter filter)
at NUnit.Core.TestSuite.RunSuite(EventListener listener, ITestFilter filter)
at NUnit.Core.TestSuite.RunSuiteInContext(EventListener listener, ITestFilter filter)
at NUnit.Core.TestSuite.Run(EventListener listener, ITestFilter filter)
at NUnit.Core.TestSuite.RunAllTests(TestResult suiteResult, EventListener listener, ITestFilter filter)
at NUnit.Core.TestSuite.RunSuite(EventListener listener, ITestFilter filter)
at NUnit.Core.TestSuite.RunSuiteInContext(EventListener listener, ITestFilter filter)
at NUnit.Core.TestSuite.Run(EventListener listener, ITestFilter filter)
at NUnit.Core.TestSuite.RunAllTests(TestResult suiteResult, EventListener listener, ITestFilter filter)
at NUnit.Core.TestSuite.RunSuite(EventListener listener, ITestFilter filter)
at NUnit.Core.TestSuite.RunSuiteInContext(EventListener listener, ITestFilter filter)
at NUnit.Core.TestSuite.Run(EventListener listener, ITestFilter filter)
at NUnit.Core.SimpleTestRunner.Run(EventListener listener, ITestFilter filter)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitTestFramework.#=qiRaO95hMU_NKiz9fhSn1tZiGseNaUPKscSzJwth8ThI=.#=qVl6GJZE$6kQEYsal_I6mkA==()
at #=qV4IY3Yw5t4EgaYNhxDl$mQCLZnuJSlEmqrATHMaf9kuVN$GE5NX224lFVpTAvNkQ.#=q$6XPpuVURa0ezT6uQzqgDwmM9wPuWSG4j0sPkq0XzSM=(Action #=qCQqo10P9uAVt1mjisBx_vzZH4DIuv1TwklAer7L4qog=)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitTestFramework.RunTests(TestOutput output, IList`1 testsToRun, MasterExecutionMapSet masterMapSet, Boolean considerInconclusiveTestsAsPassing)
at nCrunch.TestExecution.TestRunnerThread.#=qrunPHTClepwZQbgbb46aOA==(IMasterExecutionMap[] #=q6lwWDhlwcyIoeH1qADH271XREPxtA9PvlShczv8M39E=, IList`1 #=qKY93wGIDiTfNlLEKDFnuhg==, Boolean #=qWtjeCDb5$CN5QWbxqDrGiavS4BNJFchDz5s1sqYaKn6fvmPwLoe9Wj4C$wzzLLOb)

Remco
#16 Posted : Tuesday, March 13, 2012 8:44:57 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks - this looks like a similar issue. I'll let the TypeMock guys know about it.
atali
#17 Posted : Tuesday, March 13, 2012 10:15:54 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/9/2012(UTC)
Posts: 4

Was thanked: 2 time(s) in 1 post(s)
Thanks to Typemock support , the issue is solved:

This is a major issue that is not reproduced on every machine.
This is a high priority in our list and we working to find the correct fix.
One thing that we found is that it happens on machines where both VS2010 and VS2011 beta are installed.
Is this that case on your machine?

As a temporary workaround you can open the file blacklist.dat in Isolator installation directory and add the line:
System
This will probably solve the problem but will prevent you from faking anything in System namespace.

Hope that helps

Atali
2 users thanked atali for this useful post.
ylee on 3/13/2012(UTC), Remco on 3/14/2012(UTC)
ylee
#18 Posted : Tuesday, March 13, 2012 11:36:04 PM(UTC)
Rank: Member

Groups: Registered
Joined: 2/15/2012(UTC)
Posts: 20

Thanks: 6 times
Was thanked: 3 time(s) in 3 post(s)
atali;1446 wrote:
Thanks to Typemock support , the issue is solved:

This is a major issue that is not reproduced on every machine.
This is a high priority in our list and we working to find the correct fix.
One thing that we found is that it happens on machines where both VS2010 and VS2011 beta are installed.
Is this that case on your machine?

As a temporary workaround you can open the file blacklist.dat in Isolator installation directory and add the line:
System
This will probably solve the problem but will prevent you from faking anything in System namespace.

Hope that helps

Atali

Thanks, the workaround works!
Remco
#19 Posted : Wednesday, March 14, 2012 9:21:41 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
I've also had an update from TypeMock informing me that they are treating this as a priority 1 issue, so I'm sure a proper fix will be released for it soon.

Cheers,

Remco
Remco
#20 Posted : Monday, March 19, 2012 9:08:27 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
I've just tonight heard from TypeMock that they have a new version out with a fix for the above. Hopefully this will solve the issue!

Cheers,

Remco


1 user thanked Remco for this useful post.
ylee on 3/19/2012(UTC)
Users browsing this topic
Guest
2 Pages12>
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.147 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download