我有一个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