开发者

Problem getting first WP7 sample app after installing MVVMLite

I have just installed the components for MVVM item and created a project for WP7 (this is in VS10)

getting 'unable to load the metadata for assembly 'mvvmLight1' Then points me to a web reference that effectively tells me I need to unblock the file. But I did this as part of the installation, and, I have checked and itthe file are not appearing as Blocked.

The offending line is in the App.xaml

xmlns:vm="clr-namespace:MvvmLight1.ViewModel" and causes the following error

Error 1 Unable to load the metadata for assembly 'MvvmLight1'. This assembly may have been downloaded from the web. See http://go.microsoft.com/fwlink/?LinkId=179545. The following error was encountered during load: Could not load file or assembly 'MvvmLight1' or one of its dependencies. The system cannot find the file specified.

I must have done somethi开发者_JAVA百科ng wrong in the installation, but have no idea what. Any advice appreciated. Thanks

EDIT

had not altered anything from the template when I loaded it... but.. have changed as you suggested... so it looks like

xmlns:vm="clr-namespace:GalaSoft.MvvmLight.Command;
assembly=GalaSoft.MvvmLight.Extras.WP7"> 
<!--xmlns:vm="clr-     namespace:MvvmLight1.ViewModel"-->
<!--Application Resources--> <Application.Resources>
<vm:ViewModelLocator    x:Key="Locator"

but now see the following error Error 1 The type 'vm:ViewModelLocator' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

So not sure where to go from here


you have wrong namespace declaration... compare this (wrong)

xmlns:vm="clr-namespace:MvvmLight1.ViewModel" 

to this (right)

xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP7"

you missed assembly declaration...


When you first load the template, hit "ctrl+shift+B" to build the solution. This resolved my error.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜