prism - 找不到 Prism.PrismApplication
问题描述
我刚刚使用 MVVMLight、PRISM 和 DryIoc 启动了我的第一个 WPF 应用程序。App.xaml 引用 prism:PrismApplication,如https://prismlibrary.com/docs/wpf/getting-started.html中所述,没有错误。
<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。我在对象资源管理器中找到了适用于 App.xaml.cs 的 PrismApplicationBase,但在 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>
我错过了什么?
解决方案
找到了!它包含在依赖注入器容器中,即 Prism.DryIoc 或 Prism.Unity,具体取决于您使用的容器。
推荐阅读
- java - 如何在java中两次处理输入流
- android - Jetpack Navigation:任何片段都应该能够导航到任何片段
- node.js - 与副本集的猫鼬连接不起作用
- csv - 在 PySpark 中写入镶木地板的问题
- python - dict列表中的值总和错误
- c - 为什么我的编译器会创建重复的汇编函数
- hadoop - 具有活动备用名称节点的hadoop集群+编辑日志中的间隙
- python - 网格搜索中具有第三个参数的自定义记分器
- postgresql - Postgres 复制命令使用引用选项导入 .csv 在目标表中创建更多双引号
- kubernetes - Kubernetes Ingress Controller:调用 webhook 失败,拨打 tcp connect:连接被拒绝