本文介绍了ASP.NET Boilerplate - 为 MVC 和 EF 组合构建新项目时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天刚刚下载了 MVC5 和 EF 的免费启动模板.在打开,恢复所有包然后构建时,我在核心"中收到以下构建错误项目:

I have just downloaded, today, the free startup template for MVC5 and EF.On opening, restoring all packages then building, I get the following build error in the "Core" project:

错误 CS0508 'AppSettingProvider.GetSettingDefinitions(SettingDefinitionProviderContext)': 返回类型必须是 'IEnumerable' 以匹配覆盖的成员 'SettingProvider.GetSettingDefinitions(SettingDefinitionProviderContext)'

错误 CS0012 在未引用的程序集中定义了类型对象".您必须添加对程序集netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"的引用.

Error CS0012 The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

正如错误消息所建议的那样,我添加了对程序集的引用,但是,这产生了很多其他错误.

As the error message suggested, I added the reference to the assembly, however, that produced a whole lot of other errors.

查看示例项目,它们使用的是 APB 程序集的 v2.1.3,并且编译得很好.

Looking at the sample projects, they are using v2.1.3 of the APB assemblies and they compile fine.

最新下载的示例使用了 APB 程序集的 v3.0.0.

The latest downloaded sample uses v3.0.0 of the APB assemblies.

感谢任何帮助启动和运行的帮助.提前致谢.

Any help to get this up and running is appreciated. Thanks in advance.

推荐答案

AppSettingProvider already does that. Make sure you didn't modify the return type in that file.

错误 CS0012 在未引用的程序集中定义了类型对象".您必须添加对程序集netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"的引用.

更新到 VS2017 15.3.3+.对于 VS2015,安装 NETStandard.Library.NETFramework 包.

Update to VS2017 15.3.3+. For VS2015, install NETStandard.Library.NETFramework package.

这篇关于ASP.NET Boilerplate - 为 MVC 和 EF 组合构建新项目时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 15:13