本文介绍了Unity bootstrapper错误WPF MVVM项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我最近在当前项目中使用了unity bootstrapper。 I have a recent issue using unity bootstrapper on a current project. public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); //Error following line Bootstrapper bootstrapper = new Bootstrapper(); //CS0144 Cannot create an instance of the abstract class or interface 'Bootstrapper' bootstrapper.Run(); } }}//BOOTSTRAPPER has no build errors 我尝试了什么: 与github和其他地方的类似示例项目相比。What I have tried:Compared to similar example projects on github and elsewhere.推荐答案 错误告诉您Bootstrapper是一个抽象类。您需要提供自己的Bootstrapper的具体实现,即从Bootstrapper派生的实现,然后使用它。The error is telling you that Bootstrapper is an abstract class. You need to provide your own concrete implementation of Bootstrapper, i.e. one that derives from Bootstrapper, and use that instead. 这篇关于Unity bootstrapper错误WPF MVVM项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-15 01:42