views:

78

answers:

2

I wish I knew what I did to cause this, but I cannot use the Visual Studio 2008 Designer at all with with MVVMLight templates. I receive a "Could not create an instance of type 'ViewModelLocator'. in any of my xaml pages. The application builds and runs fine but only the designer is broken. In the App.xaml is

<Application x:Class="ExcelReportGenerator.App"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:vm="clr-namespace:ExcelReportGenerator.ViewModel"
         xmlns:res="clr-namespace:ExcelReportGenerator.Resources"
         Startup="Application_Startup"
         mc:Ignorable="d">

<Application.Resources>
    <!--Global View Model Locator-->
    <vm:ViewModelLocator x:Key="Locator"
                         d:IsDataSource="True" />  
</Application.Resources>

I even receive the error when I create a brand new MVVMLight application. The interesting thing is if I use an express version of VS2010 I can view, edit and work in designer just fine. As much as I would love to go to VS2010, I can't right now convince IT to make that move.

Other system information: Windows 7 (x64) prof, I also have the dpack and coderush express plugins.

A: 

You say you can use the designer in 2010. Did this issue occur after or before you installed VS 2010? It is possible that the 2010 installation caused it somehow. You can try uninstalling both studios and reinstalling 2008.

Alex Mendez
The VS2010 is sitting in a Virtual PC not in the main OS, so they aren't interfering with one another.
mcauthorn
A: 

You can try, from the vs 2008 command line, running the command "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe /setup" this will reset all studio templates.

Alex Mendez
no that did not work either. I am still seeing the same issue.
mcauthorn