开发者

Can't use Visual Studio 2008 Designer with MVVMLight V3 SP1

开发者 https://www.devze.com 2022-12-29 15:55 出处:网络
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\'. i

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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号