A fix for the design time error in MVVM Light V4.1

Posted by Laurent Bugnion on Geeks with Blogs See other posts from Geeks with Blogs or by Laurent Bugnion
Published on Sun, 11 Nov 2012 22:26:25 GMT Indexed on 2012/11/11 23:01 UTC
Read the original article Hit count: 233

Filed under:

For those of you who installed V4.1 of MVVM Light and created a project for Windows Phone 8, you will have noticed an error showing up in the design surface (either in Visual Studio designer, or in Expression Blend). The error says: “Could not load type ‘System.ComponentModel.INotifyPropertyChanging’ from assembly ‘mscorlib.extensions’” with additional information about version numbers.

The error is caused by an incompatibility between versions of System.Windows.Interactivity. Because this assembly is strongly named, any version incompatibility is causing the kind of error shown here (for an interesting discussion on the strong naming issue, see this thread on Codeplex).

I managed to resolve the issue for Windows Phone 8 and will publish a cleaned up installer next week. In the mean time, in order to allow you to continue development, please follow the steps:

  • Download the new DLLs zip package (MVVMLight_V4_1_25_WP8).
  • Right click on the Zip file and select Properties from the context menu.
  • Press the “Unblock” button (if available) and then OK.
  • Right click again on the zip package and select “Extract all…”. Select a known location for the new DLLs.
  • Open the MVVM Light project with the design time error in Visual Studio 2012.
  • Open the References folder in the Solution Explorer.
  • Select the following DLLs: GalaSoft.MvvmLight.dll, GalaSoft.MvvmLight.Extras.dll, Microsoft.Practices.ServiceLocation.dll and System.Windows.Interactivity.dll.

  • Press “delete” and confirm to remove the DLLs from your project.
  • Right click on References and select Add Reference from the context menu.

  • Browse to the folder with the new DLLs.
  • Select the four new DLLs and press OK.
  • Rebuild your application, and open it again in Blend or in the Visual Studio designer.

The error should be gone now.

In the next few days, as time allows, I will publish a new MSI containing a fixed version of the DLLs as well as a few other improvements. This quick fix should however allow you to continue working on your Windows Phone 8 projects in design mode too.

 

© Geeks with Blogs or respective owner