ASP.NET Boilerplate - Error building new project for MVC and EF combo

纵饮孤独 提交于 2019-11-28 06:24:05

问题


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:

Error CS0508 'AppSettingProvider.GetSettingDefinitions(SettingDefinitionProviderContext)': return type must be 'IEnumerable' to match overridden member 'SettingProvider.GetSettingDefinitions(SettingDefinitionProviderContext)'

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.

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

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.


回答1:


Error CS0508 'AppSettingProvider.GetSettingDefinitions(SettingDefinitionProviderContext)': return type must be 'IEnumerable' to match overridden member 'SettingProvider.GetSettingDefinitions(SettingDefinitionProviderContext)'

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

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'.

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



来源:https://stackoverflow.com/questions/46355233/asp-net-boilerplate-error-building-new-project-for-mvc-and-ef-combo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!