In order to build the latest version of the source code for MVVM Light, follow the indications:
Getting the source
- Go to the Codeplex source page.
- Download the latest change set (or any other change set that you want to get).
- Accept the license terms.
- Save the Zip file on your computer.
Building the source
- Locate the Zip file you just downloaded (named something like “mvvmlight-5056f53e22e0.zip”).
- Right click the file and select Properties.
- If the “Unblock” button is visible in the Properties dialog, click it.
- Extract the content of the Zip file.
- Open GalaSoft.MvvmLight.sln in Visual Studio 2010 (this file is located in the GalaSoft.MvvmLight folder).
- Build the solution. You can select either the Debug or Release configuration (or both).
Running unit tests
MVVM Light’s tests can be run in MSTEST directly in Visual Studio. However, the tests in the .NET4 version of MVVM Light will fail if you leave the assemblies signed. To remove the signing of the assemblies, follow the steps:
- Open the solution GalaSoft.MvvmLight (NET4).sln.
- Right click on the project GalaSoft.MvvmLight (NET4) in the Solution Explorer and select Properties from the context menu.
- Select the tab Signing.
- Uncheck the checkbox labeled Sign the assembly.
- Repeat this for the project GalaSoft.MvvmLight.Extras (NET4).
- Run the tests with the menu Test, Run, All Tests in Solution.
- After the tests are run, recheck both checkboxes labeled Sign the assembly.
- Rebuild the projects.
In .NET3.5
For .NET3.5, open the solution GalaSoft.MvvmLight (NET35).sln. Then select the menu Test, Run, All Tests in Solution.
In Silverlight 3 and Silverlight 4
Open the solution GalaSoft.MvvmLight.sln. Then right click on the project GalaSoft.MvvmLight.Test (SL3) and select Set as StartUp Project from the context menu. Run the tests by selecting the menu Debug, Start Without Debugging (Ctrl-F5).
You can do the same for Silverlight 4 with the project GalaSoft.MvvmLight.Test (SL4), and for Silverlight 5 with the project GalaSoft.MvvmLight.Test (SL5).
In Windows Phone 7
Open the solution GalaSoft.MvvmLight (WP7).sln. Right click on the project GalaSoft.MvvmLight.Test (WP7) and select Set as StartUp Project from the context menu. Run the tests by selecting the menu Debug, Start Without Debugging (Ctrl-F5).
You can choose to run the tests in the emulator or on a physical device by selecting the corresponding option in the dropbox shown below.
Installing the new binaries
In order to enjoy the new features, you need to replace already installed binaries (if available) with the new version.
Note: This assumes that a previous version of MVVM Light had already been installed previously.
- Locate and execute the BAT file named gatherbinaries.bat.
- This BAT file creates a new folder named _Binaries in the GalaSoft.MvvmLight folder.
- In _Binaries, open either the Debug or Release subfolders.
- Copy the content of the selected subfolder (Silverlight3, Silverlight4, WP7, WPF35SP1 and WPF4 subfolders).
- Open C:\Program Files\Laurent Bugnion (GalaSoft)\Mvvm Light Toolkit\Binaries
- Paste the folders you just copied.
Warning: This will replace the previously installed binaries with the new ones. If you want to keep the “old” binaries, you need to back them up before!