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

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_26.zip). 
  • 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.

Special note for WP7.1

Because of some issues with the WP7.1 version of the DLLs, I had to (hopefully temporarily) remove the INotifyPropertyChanging interface from the ObservableObject and ViewModelBase classes. I am talking with Microsoft to try and solve this issue. In the meantime, I hope that this change will not affect too many people.

 

Print | posted on Sunday, November 11, 2012 11:26 PM

Feedback

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

left by Wot at 12/11/2012 7:07 AM Gravatar
I'm sorry, my English is very rotten!
In WP7 project I add MVVMLight_V4_1_25_WP71 the four new DLL, it indicates that the project is as follows: unable to add to a senior version or not compatible programs reference! This reason is what? Thank you very much

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

left by Anton at 12/16/2012 6:59 AM Gravatar
Wot, I faced the same issue, however when I "unlocked" the zip archive the problem disappeared.

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

left by Jim at 12/17/2012 10:39 AM Gravatar
It seems the WP7.1 link is broken. Can you restore it?

Thanks!

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

left by Laurent at 12/17/2012 2:14 PM Gravatar
Sorry, I made some fixes and forgot to update the article. Please use http://sdrv.ms/UUyOfU and I will fix the article now.

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

left by Benoist LUGNIER at 12/19/2012 10:18 AM Gravatar
New link MVVMLight_V4_1_26.zip

http://sdrv.ms/UUyOfU

hope this will help

Benoist LUGNIER

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

left by Wot at 12/19/2012 5:15 PM Gravatar
Hi Laurent!Thank you very much for your help! Let my code can work! Thank you very much!

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

left by Manfred at 12/29/2012 5:19 PM Gravatar
I hope you'll find the time to propagate this version to nuget soon. That will keep my solutions 'clean' (and almost all my WP7/W(P)8 projects depend on Mvvm Light :-o ).


Thank you,

Manfred

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

left by Daniel at 3/21/2013 2:10 AM Gravatar
Hi Laurent, I'm using VS 2010.. should I use version 4 RTM or there is a 4.1 for VS 2010 ?
Thanks
(cant find it on codeflex)
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: