ReflectionTypeLoadExecption when browser launches

Jul 1, 2010 at 2:51 PM

Has anybody else had an issue with a ReflectionTypeLoadExecption popping up when trying to run a set of tests? Statlight loads properly, launches a browser window and displays the test page for a split second, then the page goes blank and a script error pops up. I'm using the newest release of both Statlight and the Silverlight testing framework. Thanks in advance.

Coordinator
Jul 1, 2010 at 5:17 PM
Can you attempt to give the full stack trace to help further diagnose the problem?
Jul 1, 2010 at 6:20 PM

Line: 54

Char: 13

Error: Unhandled Error in Silverlight Application

         Code: 4004

         Category: ManagedRuntimeError

         Message: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

         at System.Reflection.RuntimeModule.GetTypes(RuntimeModule (cannot read rest of line)

         at System.Reflection.RuntimeModule.GetTypes()

         at System.Reflection.Assembly.GetTypes()

         (line unreadble b/c of dialog buttons)

        at Microsoft.Silverlight.Testing.UnitTesting.Metadata.UnitTestProviders.GetAssemblyProvider(UnitTestHarness harness, Assembly testAssembly)

        at Microsoft.Silverlight.Testing.Harness.UnitTestHarness.PrepareTestAssemblyTasks()

        at Microsoft.Silverlight.Testing.Harness.UnitTestHarness.Initialize()

        at Microsoft.Silverlight.Testing.Harness.UnitTestHarness.Run()

        at Microsoft.Silverlight.Testing.UnitTestSystem.Run(UnitTestSettings settings)

        at Microsoft.Silverlight.Testing.UnitTestSystem.<>c__DisplayClass1.<CreateTestPage>b__0()

        at Microsoft.Silverlight.Testing.UnitTestSystem.<>c__DisplayClass6.<PrepareTestService>b__3()

        at Microsoft.Silverlight.Testing.UnitTestSystem.<>c__DisplayClass8.<PrepareTestService>b__4(Object sender, EventArgs e)

        at Microsoft.Silverlight.Testing.Service.ProviderBase.OnInitializeCompleted()

        at Microsoft.Silverlight.Testing.Harness.TestServiceProvider.InitializeAllServices()

        at Microsoft.Silverlight.Testing.Harness.TestServiceProvider.<InitializeAllServices>b__2(Object sender, EventArgs e)

        at Microsoft.Silverlight.Testing.Service.ProviderBase.OnInitializeCompleted()

        at Microsoft.Silverlight.Testing.Service.IsolatedStorageSettingsProvider.Initialize()

        at Microsoft.Silverlight.Testing.Harness.TestServiceProvider.InitializeAllServices()

        at Microsoft.Silverlight.Testing.Service.SilverlightTestService.<AttemptServiceConnection>b__8()

        at Microsoft.Silverlight.Testing.Service.SilverlightTestService.ServiceVerifier.<>c__DisplayClassa.<Verify>b__9(ServiceResult result)

        at Microsoft.Silverlight.Testing.Service.WebTestService.UserInterfaceThreadCallback(Object state)

 

This is all I was able to get from the window that wasn't covered by dialog buttons/messages, couldn't copy/paste the text :(

Jul 1, 2010 at 7:09 PM

Was able to get the whole stacktrace finally:

 

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Timestamp: Thu, 1 Jul 2010 19:08:24 UTC


Message: Unhandled Error in Silverlight Application
Code: 4004    
Category: ManagedRuntimeError       
Message: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at System.Reflection.Assembly.GetTypes()
   at StatLight.Client.Harness.Hosts.MSTest.UnitTestProviders.MSTest.UnitTestFrameworkAssembly.GetTestClasses()
   at Microsoft.Silverlight.Testing.UnitTesting.Metadata.UnitTestProviders.GetAssemblyProvider(UnitTestHarness harness, Assembly testAssembly)
   at Microsoft.Silverlight.Testing.Harness.UnitTestHarness.PrepareTestAssemblyTasks()
   at Microsoft.Silverlight.Testing.Harness.UnitTestHarness.Initialize()
   at Microsoft.Silverlight.Testing.Harness.UnitTestHarness.Run()
   at Microsoft.Silverlight.Testing.UnitTestSystem.Run(UnitTestSettings settings)
   at Microsoft.Silverlight.Testing.UnitTestSystem.<>c__DisplayClass1.<CreateTestPage>b__0()
   at Microsoft.Silverlight.Testing.UnitTestSystem.<>c__DisplayClass6.<PrepareTestService>b__3()
   at Microsoft.Silverlight.Testing.UnitTestSystem.<>c__DisplayClass8.<PrepareTestService>b__4(Object sender, EventArgs e)
   at Microsoft.Silverlight.Testing.Service.ProviderBase.OnInitializeCompleted()
   at Microsoft.Silverlight.Testing.Harness.TestServiceProvider.InitializeAllServices()
   at Microsoft.Silverlight.Testing.Harness.TestServiceProvider.<InitializeAllServices>b__2(Object sender, EventArgs e)
   at Microsoft.Silverlight.Testing.Service.ProviderBase.OnInitializeCompleted()
   at Microsoft.Silverlight.Testing.Service.IsolatedStorageSettingsProvider.Initialize()
   at Microsoft.Silverlight.Testing.Harness.TestServiceProvider.InitializeAllServices()
   at Microsoft.Silverlight.Testing.Service.SilverlightTestService.<AttemptServiceConnection>b__8()
   at Microsoft.Silverlight.Testing.Service.SilverlightTestService.ServiceVerifier.<>c__DisplayClassa.<Verify>b__9(ServiceResult result)
   at Microsoft.Silverlight.Testing.Service.WebTestService.UserInterfaceThreadCallback(Object state)     

Line: 54
Char: 13
Code: 0
URI: http://localhost:8887/GetHtmlTestPage

Jul 1, 2010 at 7:43 PM

After testing on my laptop I think that it's a problem with my .Net installation, which has been having problems. Thanks for the help.

 

Coordinator
Jul 1, 2010 at 8:50 PM
Edited Jul 1, 2010 at 9:02 PM
Glad you got it resolved... I have actually had a TODO around this issue for a while now http://statlight.codeplex.com/workitem/10878. Regarding this scenario. Now that someone else's experienced troubles - I'll probably push it's priority a little more. Happy Testing!
Coordinator
Jul 1, 2010 at 9:01 PM
Edited Jul 1, 2010 at 9:01 PM
FYI: I also just created another work item (that's been on my mind for a while) regarding your experience in gathering troubleshooting information... http://statlight.codeplex.com/workitem/11356
Jul 7, 2010 at 9:22 PM
So it turns out that there is another issue. I've tried to runt the program on 4 different computers now, 2 of them displayed the above error. The 2 that were able to run the program were a Windows 7 machine and a Windows XP machine. The 2 that were not able to run were both Windows XP machines.
Coordinator
Jul 7, 2010 at 10:53 PM

Could you try creating a more recent build of statlight http://github.com/staxmanade/statlight - I've made some changes to help report the specific type load exceptions. Hopefully a step in the right direction.

Let me know what you find there?

Coordinator
Jul 7, 2010 at 11:53 PM
Edited Jul 7, 2010 at 11:54 PM
captaincrash80 wrote:
So it turns out that there is another issue. I've tried to runt the program on 4 different computers now, 2 of them displayed the above error. The 2 that were able to run the program were a Windows 7 machine and a Windows XP machine. The 2 that were not able to run were both Windows XP machines.

I had a seperate user (through an email, describe a type load exceptions on an XP machine) and we found about the following. (Uninstalling the KB fixed his issue)

Here's what I found with a little googling...

http://stackoverflow.com/questions/3004299/wcf-service-errors-after-installing-windowsxp-updates


This link suggests the same thing.
http://social.msdn.microsoft.com/Forums/en/wcf/thread/db045125-7fff-4531-86cd-ed9aa188a0ac


(Uninstalling KB976769v2)