2015-12-06 28 views
0

這是我在ASP.NET 5(vNext)之前的舊代碼更改。在ASP.NET 5(vNext)中使用System.ComponentModel.Description

public enum HashType : short { 
    [System.ComponentModel.Description("SHA1CryptoServiceProvider")] 
    SHA1 = 0, 
    [System.ComponentModel.Description("SHA256Managed")] 
    SHA256 = 1, 
    [System.ComponentModel.Description("SHA384Managed")] 
    SHA384 = 2, 
    [System.ComponentModel.Description("SHA512Managed")] 
    SHA512 = 3, 
    [System.ComponentModel.Description("MD5CryptoServiceProvider")] 
    MD5 = 4 
} 

現在,它給了我這個錯誤:

The type or namespace name 'Description' does not exist in the namespace 'System.ComponentModel' (are you missing an assembly reference?) UtilityPackage..NET Platform 5.4

如果我在上面

enter image description here

移動鼠標這只是沒有到此爲止,代碼的另一部分給出例外太。像這樣的:

enter image description here

或這一個

enter image description here

而且我應該提到這個代碼完全在我的舊classlibrary。

回答

0

說明屬性不再可用。使用System.ComponentModel.DataAnnotation.DisplayAttribute