ASP.NET Boilerplate - Error building new project f

2019-01-27 04:28发布

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条回答
Melony?
2楼-- · 2019-01-27 05:29

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

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

查看更多
登录 后发表回答