我刚刚使用MVVMLight、PRISM和DryIoc启动了我的第一个WPF应用程序。App.xaml引用https://prismlibrary.com/docs/wpf/getting-started.html中描述的prism:prism应用程序,没有错误。
<prism:PrismApplication x:Class="DYC.MembershipAndDues.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DYC.MembershipAndDues"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:prism="http://prismlibrary.com/"
xmlns:vm="clr-namespace:DYC.MembershipAndDues.ViewModel"
xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006"
d1p1:Ignorable="d"
DispatcherUnhandledException="Application_DispatcherUnhandledException">
<Application.Resources>
<ResourceDictionary>
<vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" />
</ResourceDictionary>
</Application.Resources>
</prism:PrismApplication>在App.xaml.cs中找不到Prism.PrismApplication。我在对象资源管理器中找到了PrismApplicationBase,它适用于App.xaml.cs,但在App.xaml中,找不到prism:PrismApplicationBase。在xmlns:prism="http://prismlibrary.com/“处的xaml声明和我加载的包之间似乎有一个脱节。
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommonServiceLocator" version="2.0.5" targetFramework="net472" />
<package id="DryIoc.dll" version="4.0.7" targetFramework="net472" />
<package id="MvvmLight" version="5.4.1.1" targetFramework="net472" />
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net472" />
<package id="Prism.Core" version="7.2.0.1422" targetFramework="net472" />
<package id="Prism.DryIoc" version="7.2.0.1422" targetFramework="net472" />
<package id="Prism.Wpf" version="7.2.0.1422" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
</packages>我遗漏了什么?
发布于 2020-09-15 12:16:50
找到了!它包含在依赖注入器容器中,即Prism.DryIoc或Prism.Unity,具体取决于您使用的容器。
https://stackoverflow.com/questions/63894892
复制相似问题