惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

I
Intezer
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
AWS News Blog
AWS News Blog
G
GRAHAM CLULEY
P
Privacy & Cybersecurity Law Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cybersecurity and Infrastructure Security Agency CISA
N
News | PayPal Newsroom
T
Tenable Blog
Spread Privacy
Spread Privacy
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
P
Privacy International News Feed
IT之家
IT之家
Project Zero
Project Zero
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
博客园_首页
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
量子位
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
NISL@THU
NISL@THU
I
InfoQ
D
DataBreaches.Net
有赞技术团队
有赞技术团队
K
Kaspersky official blog
Security Latest
Security Latest
The Register - Security
The Register - Security
Hugging Face - Blog
Hugging Face - Blog
S
Security @ Cisco Blogs
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
AI
AI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
N
News and Events Feed by Topic

博客园 - Zhenway

Azure SignalR支持replication啦 Azure SignalR总览 定制json序列化 今天折腾这么一个正则 docfx组件介绍--YamlSerialization docfx daylybuild docfx开源啦 docfx组件介绍--MarkdownLite docfx预热中 合并批量请求 一个简单的Linq to TreeNode 在finally中调用一个需要await的方法 当泛型方法推断,扩展方法遇到泛型类型in/out时。。。 一个非常简单的反射加速方案 加载时预防并发执行 又发现一个msdn的坑 又发现个.net framework的坑 sql server死锁神器 踩到一个Emit的坑,留个纪念
4.5你太黑了,不带这么玩TypeForwardedTo的
Zhenway · 2014-02-25 · via 博客园 - Zhenway

话说最近好不容易把framework 4.0的metadata信息都能全部抽出了,结果换4.5挂了。。。framework那帮人在4.5里面用了些什么诡异的玩意?

结果一看4.5的部分field用了typed function pointer这个诡异的类型,好吧,还好之前留好空挡了,就等有空的时候去填空,现在就乖乖的补上实现,最多麻烦点,field signature里面放个类型,类型里面可以选typed function pointer,typed function pointer里面有个method signature,method signature里面继续有类型,当然类型里面要是他们高兴继续可以来个typed function pointer。。。稀里哗啦的敲上一堆代码,跑下单元测试,过了,很开心的再测试一下整个4.5,结果。。。挂了,报错是在System.Runtime.dll里找不到System.ValueType。。。

这是什么情况?!System.ValueType当然不在这里,应该在mscorlib里面,一看报错的地方是System.Runtime.xxxx.dll,无语,看看这个dll没啥特殊的,一时之间也晕掉了。

瞎摸索了一阵,无意间反编译了下System.Runtime.dll,被惊呆了,这个dll里面没有一行代码,只有一堆TypeForwardedTo,常用类型都有一个,基础到System.Int32、System.String、System.Void,还有各种Action和Func,方式常用的都来一份。。。

TypeForwardedTo这个特性本来是为了无缝升级framework用的,没想到4.5那帮人竟然直接拿它当别名用,这下这边的代码可算是被它坑死了,也不得不去识别这个特性,查找类型时也需要多留个心眼,这个复杂度。。。哎。。。郁闷。。。