Prism 7.1:没有适合的方法来覆盖方法RegisterTypes和CreateShell

时间:2018-11-04 01:18:14

标签: wpf prism

我正在使用Prism v7.1构建我的第一个应用程序。在App.xaml.cs中,我具有以下内容:

using Prism.Ioc;
using Prism.Unity;
using System.Windows;

namespace ScanMiner
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : PrismApplication
    {
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            throw new System.NotImplementedException();
        }

        protected override Window CreateShell()
        {
            return Container.Resolve<MainWindow>();
        }
    }
}

我在RegisterTypes和CreateShell下有红色的波浪线,并且出现一条错误,指出找不到合适的方法来覆盖。我在容器下也有一个红色的波浪状。并显示一条错误消息“当前上下文中不存在名称'Container'。

我的App.xaml看起来像这样:

<prism:PrismApplication x:Class="ScanMiner.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:prism="http://prismlibrary.com/"
         xmlns:local="clr-namespace:ScanMiner">
    <Application.Resources>

    </Application.Resources>
</prism:PrismApplication>

1 个答案:

答案 0 :(得分:0)

这个问题原来是一个红色鲱鱼,或者是Visual Studio错误。尽管错误仍然存​​在,但我成功构建了解决方案,错误消失了。

相关问题