说明属性在DNX Core 5.0中不可用 [英] DescriptionAttribute not available in DNX Core 5.0
本文介绍了说明属性在DNX Core 5.0中不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在ASP.NET 5
项目中的DescriptionAttribute
遇到了问题.
I'm having an issue with DescriptionAttribute
in ASP.NET 5
project.
我想对enum
类使用DescriptionAttribute
,但是由于缺少DNX Core 5.0中的引用而无法构建该项目
I wanted to use DescriptionAttribute
for my enum
class, but the project cannot be built due to missing reference in DNX Core 5.0
这是我的project.json文件
Here's my project.json file
{
"userSecretsId": "",
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-final",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-rc1-final",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",
"Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"dnx451": {
"frameworkAssemblies": {
}
},
"dnxcore50": {
"frameworkAssemblies": {
},
"dependencies": {
}
}
},
"exclude": [
"wwwroot",
"node_modules"
],
"publishExclude": [
"**.user",
"**.vspscc"
],
"scripts": {
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
}
}
推荐答案
System.ComponentModel.DescriptionAttribute
在CoreCLR中不可用.
System.ComponentModel.DescriptionAttribute
is not available in CoreCLR.
您有两个选择:
- 找到它的替代品或自己实现.
- 从
project.json
中受支持的框架列表中删除
dnxcore50
(CoreCLR).
- Find a replacement for it or implement it yourself.
- Remove
dnxcore50
(CoreCLR) from your supported framework list inproject.json
这篇关于说明属性在DNX Core 5.0中不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文