HyperDescriptor 在 .NET 4 中构建时可以工作吗?
我正在开发一个 .NET 4 项目,并且能够从 HyperDescriptor提供了,但是在.NET 4中构建时它似乎无法正常工作。我从CodeProject下载了源代码,将解决方案项目转换为VS2010,并将目标框架更新为4.0。当它构建并且示例正确执行时,时间显示使用 HyperDescriptor 进行动态属性访问是获取/设置对象值最慢的可能方式。
仅当您使用 .NET 4 从源代码构建 HyperDescriptor 时才会出现此问题。如果从 .NET 4 项目添加对使用 .NET 2 构建的 HyperDescriptor 的引用,则它可以正常工作。目前这是一个可以接受的解决方案,但是使用 .NET 4 构建会有一些潜在的优势吗?有人想尝试一下 HyperDescriptor,看看为什么 .NET 4 构建速度这么慢?
I'm working on a .NET 4 project, and would be able to benefit from the dynamic property access that HyperDescriptor provides, but it doesn't seem to be working properly when built in .NET 4. I downloaded the source from CodeProject, converted the solution an projects to VS2010, and updated the target framework to 4.0. While it builds, and the sample executes correctly, the timings show that dynamic property access with HyperDescriptor is the slowest possible way of getting/setting object values.
This problem is only when you build HyperDescriptor from source with .NET 4. If from your .NET 4 project, you add a reference to HyperDescriptor built with .NET 2, it works fine. This is an acceptable solution for now, but would there be some potential advantage to using a .NET 4 build? Anyone want to take a crack at HyperDescriptor, see why it's so slow with a .NET 4 build?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我下载了源代码并使用 .NET 4 运行测试。抛出和捕获的
InvalidOperationException
数量令人印象深刻,导致速度缓慢。转到
HyperTypeDescriptionProvider.BuildDescriptor
并将:替换为:
AllFlags 已弃用,只会导致警告,但从安全透明方法进行断言在 .NET 4 中无效。请参阅 .NET Framework 4 中的安全更改了解详细信息。
I downloaded the source code and ran the test with .NET 4. There's an impressive number of
InvalidOperationException
thrown and caught, causing the slowness.Go to
HyperTypeDescriptionProvider.BuildDescriptor
and replace:by:
AllFlags is deprecated and only causes a warning, but asserting from a security transparent method isn't valid in .NET 4. See Security Changes in the .NET Framework 4 for more information.