0

我希望我知道我做了什么导致这种情况,但我根本无法将 Visual Studio 2008 Designer 与 MVVMLight 模板一起使用。我在我的任何 xaml 页面中都收到“无法创建类型为 'ViewModelLocator' 的实例。应用程序构建和运行正常,但只有设计器损坏。在 App.xaml 中

<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>

我什至在创建全新的 MVVMLight 应用程序时收到错误消息。有趣的是,如果我使用 VS2010 的快速版本,我可以很好地查看、编辑和在设计器中工作。尽管我很想去 VS2010,但我现在无法说服 IT 采取行动。

其他系统信息:Windows 7 (x64) prof,我还有 dpack 和 coderush express 插件。

4

2 回答 2

0

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.

于 2010-05-11T20:00:00.637 回答
0

你说你可以在2010年使用设计器。这个问题是在你安装VS 2010之后还是之前出现的?2010 年的安装可能会以某种方式导致它。您可以尝试卸载这两个工作室并重新安装 2008。

于 2010-05-10T18:57:48.120 回答