2010-05-10 83 views
0

我希望我知道我做了什麼,但我無法使用Visual Studio 2008 Designer和MVVMLight模板。我收到一個「無法創建類型‘ViewModelLocator’的一個實例。在我的任何XAML頁面。該應用程序生成並運行良好,但只爲設計師被打破了。在App.xaml中是不能使用Visual Studio 2008設計器和MVVMLight V3 SP1

<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表達插件。

回答

0

你說你可以在2010年使用該設計器。在安裝VS 2010之後或之前發生過這個問題嗎? 2010年的安裝可能會以某種方式造成它。您可以嘗試卸載這兩個工作室並重新安裝2008.

+0

VS2010坐在虛擬PC中,不在主操作系統中,因此它們不會互相干擾。 – mcauthorn 2010-05-10 19:00:48

0

您可以嘗試從vs 2008命令行運行命令「C:\ Program Files \ Microsoft Visual Studio 9.0 \ Common7 \ IDE \ devenv.exe/setup」這將重置所有演播室模板。

+0

沒有,也沒有工作。我仍然看到同樣的問題。 – mcauthorn 2010-05-12 11:05:17

相關問題