我得到了以下app.xml的:标签 '引导程序' 并不在XML命名空间存在 'CLR的命名空间:XXX'
<Application
x:Class="WeDoneIt.WP2.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WeDoneIt.WP2"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">
<Application.Resources>
<local:Bootstrapper x:Key="bootstrapper" />
</Application.Resources>
</Application>
和引导程序:
namespace WeDoneIt.WP2
{
public class Bootstrapper : Caliburn.Micro.Autofac.AutofacBootstrapper
{
public Bootstrapper()
{
Instance = this;
}
protected static Bootstrapper Instance { get; private set; }
protected override void ConfigureContainer(ContainerBuilder builder)
{
builder.RegisterType<ShellViewModel>();
builder.RegisterType<ItemViewModel>();
base.ConfigureContainer(builder);
}
public static T ResolveModel<T>() where T : INotifyPropertyChangedEx
{
return (T)Instance.GetInstance(typeof (T), null);
}
}
}
为什么就可以了找不到?
它的标签为wpf,但我看到'Microsoft.Phone'命名空间...所以你使用WPF或WP7,因为引导是不同的[见](http://caliburnmicro.codeplex.com/wikipage?title=Basic%20Configuration%2c%20Actions%20and%20Conventions&referringTitle =文档)。否则你的代码看起来很好,你可以发布完整的stacktrace吗?您的'WeDoneIt.WP2.App'和'Bootstrapper'是否在同一个程序集中? – nemesv 2012-07-29 11:33:41
修复了标签,是的,它们在同一个组件中。 – jgauffin 2012-07-29 12:31:18