首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到Prism.PrismApplication

找不到Prism.PrismApplication
EN

Stack Overflow用户
提问于 2020-09-15 12:03:16
回答 1查看 514关注 0票数 2

我刚刚使用MVVMLight、PRISM和DryIoc启动了我的第一个WPF应用程序。App.xaml引用https://prismlibrary.com/docs/wpf/getting-started.html中描述的prism:prism应用程序,没有错误。

代码语言:javascript
复制
<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声明和我加载的包之间似乎有一个脱节。

代码语言:javascript
复制
<?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>

我遗漏了什么?

EN

回答 1

Stack Overflow用户

发布于 2020-09-15 12:16:50

找到了!它包含在依赖注入器容器中,即Prism.DryIoc或Prism.Unity,具体取决于您使用的容器。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63894892

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档