我有一個Portable Classlibrary。我應該在NETPortable中引用哪一個,找不到GetMethods
」 .NETPortable,版本= V4.5,外形= Profile75"
代碼
typeof(T).GetMethods()
與錯誤
cannot resolve symbol 'GetMethods'
我project.json
{
"supports": {},
"dependencies": {
},
"frameworks": {
".NETPortable,Version=v4.5,Profile=Profile75": { },
"net541": { },
"dotnet5.4": {
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23516",
"System.Collections": "4.0.11-beta-23516",
"System.Linq": "4.0.1-beta-23516",
"System.Runtime": "4.0.21-beta-23516",
"System.Threading": "4.0.11-beta-23516",
"System.Reflection": "4.1.0-beta-23516",
"System.Collections.Concurrent": "4.0.11-beta-23516"
}
}
}
}
和cspro中的關鍵屬性Ĵ文件
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile75</TargetFrameworkProfile>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
謝謝。 typeof(T).GetTypeInfo()。DeclaredMethods is work – chsword
@chsword:好的 - 只要你只需要聲明的方法,當然!令人討厭的是,我無法自己複製它......當我無法找到預定義類型時,我不知道問題是什麼。例如, –
? @Jon Skeet – chsword