类型不包含“ GetProperties”的定义 [英] Type does not contain a definition for 'GetProperties'
本文介绍了类型不包含“ GetProperties”的定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在将库项目迁移到.net标准,当我尝试使用 System.Reflection
API调用<$ c时,出现以下编译错误$ c> Type:GetProperties():
I am migrating a library project to a .net standard and I am getting the following compilation error when I try to use the System.Reflection
API to call Type:GetProperties()
:
类型不包含 GetProperties的定义
Type does not contain a definition for 'GetProperties'
这里是我的 project.json
:
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable"
},
"dependencies": {},
"frameworks": {
"netstandard1.6": {
"dependencies": {
"NETStandard.Library": "1.6.0"
}
}
}
}
我想念什么?
推荐答案
在撰写本文时, GetProperties()
现在是:
As of writing this, GetProperties()
is now:
typeof(Object).GetTypeInfo()。DeclaredProperties;
这篇关于类型不包含“ GetProperties”的定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文