Runtime error: Module TypeLoadingException was unhandled by user code

Topics: Prism v4 - Silverlight 4
Sep 29, 2010 at 3:50 AM

I tried to run RegionNavigation in the Quickstarts from Drop 8, when I started to run the app, got following runtime error: Failed to load type for module RegionNavigation.Calendar. Error was: An exception occurred during a WebClient request.. It seems that there is problem during loading "Calendar", actually, any module can not be loaded (for example, I only define one module in ModulesCatalog.xaml, then load it, the same error still there), I could not figure out what could be wrong. I must miss some critical stuff. Could someone give your insight suggestions? Thanks lot!

Sep 29, 2010 at 3:30 PM

Hi,

This might be related to it is necessary to set the RegionNavigation.Web project as startup project. You could check this information in the readme file (see Navigation Quickstart section) of the lastest drop of Prism.

Please let me know if this help.

Fernando Antivero
http://blogs.southworks.net/fantivero

 

Sep 29, 2010 at 3:42 PM
Hi, Fernando,

Thank you very much for your response.

I did set RegionNavigation.Web as startup project, still the same.

Shirley


From: [email removed]
To: [email removed]
Date: Wed, 29 Sep 2010 07:30:25 -0700
Subject: Re: Runtime error: Module TypeLoadingException was unhandled by user code [CompositeWPF:228936]

From: fantivero
Hi,
This might be related to it is necessary to set the RegionNavigation.Web project as startup project. You could check this information in the readme file (see Navigation Quickstart section) of the lastest drop of Prism.
Please let me know if this help.
Fernando Antivero
http://blogs.southworks.net/fantivero

Read the full discussion online.
To add a post to this discussion, reply to this email (CompositeWPF@discussions.codeplex.com)
To start a new discussion for this project, email CompositeWPF@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Sep 29, 2010 at 7:20 PM
Edited Sep 29, 2010 at 7:21 PM

Hi Shirley,

This is certainly strange, I faced with the same situation and found no issues by performing this configuration.  I would recommend you start this Quickstart from scratch and set only the RegionNavigation.Web project as startup.

Is there any message in your output window?

If you continue experiencing this, could you send this quickstart? So in case that we confirm this as an issue, I could create a work-item for this.

Thanks for reporting that.

Fernando Antivero
http://blogs.southworks.net/fantivero

 

Sep 30, 2010 at 6:35 PM
Hi, Fernando:

I re-check the issue(s) and find something which seem related with the reference of "Micorsoft.practices.Prism.MefExtensions". I am quite confused by the phenomena, I describe as follow, hope to get some of your insight suggestions.

Here are the processes I conducted, hope they are helpful to you understanding my issue, please let me know what step(s) I did was (were) wrong or you have some restriction by referencing Prism library:

1. Download Drop 8.
2. Run Desktop & Silverlight - Open Prism Library.bat. Successfully compile all projects.
3. Extract comonents DLL from different folders to form a new library folder, say "MyPrismLibrary", example, copy the new generated "Microsoft.Practices.Prism.MefExtensions.dll" to "MyPrismLibrary", etc.
4. Go to Quickstarts - Navigation - Open RegionNavigation.Silverlight solution
5. Go to RegionNavigation project - go to reference - remove Microsoft.practices.Prism.MefExtensions - ADD this DLL from new generated "MyPrismLibrary"
6. Run application. The I got following errors. Note the error is random, one could show this (see attach Figure 1), another could show this (see attach Figure 2).
7. Then I remove this reference again, add ORIGINAL reference from LIB folder. Error not gone, still there.
8. If I un-zip a brand-new drop 8, go to Navigation folder to run the application, everything is fine. The important point is that this setting now is exactly the same as above step #7.

What are wrong? I am completely baffled.

Thank you very much!

Shirley





From: [email removed]
To: [email removed]
Date: Wed, 29 Sep 2010 11:20:45 -0700
Subject: Re: Runtime error: Module TypeLoadingException was unhandled by user code [CompositeWPF:228936]

From: fantivero
Hi,
This is certainly strange, I faced with the same situation and found no issues by performing this change. I would recommend you start this Quickstart from scratch and set only the RegionNavigation.Web project as startup.

Is there any message in your output window?

If you continue experiencing this, could you send this quickstart? So in case that we confirm this as an issue, I could create a work-item for this.

Thanks for reporting that.
Fernando Antivero
http://blogs.southworks.net/fantivero

Read the full discussion online.
To add a post to this discussion, reply to this email (CompositeWPF@discussions.codeplex.com)
To start a new discussion for this project, email CompositeWPF@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Sep 30, 2010 at 7:32 PM

Hi Shirley,

Please take into account that the images attached are not posted in Codeplex. First of all, I am seeing that you missed to list the step that set the RegionNavigation.Web project as startup project.

Have you performed this step? Since it is strictly necessary to get this Quickstar running.

The following steps might help you:

  1. Download Prism v4 - Drop 8 from here and executes the downloaded file.
  2. Open the Prism installation folder.
  3. Go to the Lib\Silverlight\Moq  folder and follow the instructions in the readme.txt for downloading moq.
  4. Go to the Lib\Desktop\Moq  folder and follow the instructions in the readme.txt for downloading moq.
  5. Back to the Prism installation folder and execute Desktop & Silverlight – Open Prism Library.bat file.
  6. Compile the solution and close the solution.
  7. Go to RegionNavigationQuickstar folder and open the solution.
  8. Go to the references section of the RegionNavigation project remove the following references:
    • Microsoft.Practices.ServiceLocation
    • System.Windows.Interactivity
  9. Add again the aforementioned references from Lib\Silverlight\Prism folder.
  10. Set the RegionNavigation.Web project as the startup project.
  11. Press F5.

If you need more information of these steps, you could check the INSTALLING AND COMPILING PRISM and QUICKSTARTS – Navigation Quickstart sections in the Readme.mht file, which is part of Prism Drop 8.

The step 8 and 9 represent a known issue and it will be solved in future drops.

I hope this help.

Fernando Antivero
http://blogs.southworks.net/fantivero