为什么 NGEN 应该挂起并且永远不会完成特定程序集的任何原因?

发布于 2024-08-28 14:24:07 字数 1247 浏览 3 评论 0原文

我有一个使用 Visual Studio 2008 构建的 .NET 3.5 类库项目。

如果我尝试 NGEN 此解决方案文件中的核心程序集,NGEN 永远不会完成,或者至少在我费心让它运行时不会完成(例如过夜)。

还有其他人经历过吗?如果是这样,你解决了吗?如果你这样做了,又是怎样做的呢?您采取了哪些步骤?

如果这是 NGEN 中的错误,我如何将其发布给 Microsoft?我有一个连接帐户,但我应该在哪里发布此特定产品的错误报告,而不是 .NET 类(我知道该去哪里获取)。

可以在此处找到有问题的类库:

有问题的程序集是 LVK.Core 程序集。

更新:NGEN for .NET 4.0 已完成,但花了近 15 分钟才完成:

time /t
12:44:39
ngen install lvk.core.dll
Microsoft (R) CLR Native Image Generator - Version 4.0.30319.1
Copyright (c) Microsoft Corporation.  All rights reserved.
Installing assembly C:\Dev\VS.NET\LVK\LVK.Core\bin\x86\Debug\lvk.core.dll
    Compiling assembly C:\Dev\VS.NET\LVK\LVK.Core\bin\x86\Debug\lvk.core.dll (CLR v2.0.50727) ...
LVK.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=8dbb1dd9b1276c0a <debug>
time /t
12:59:24

更新 #2:Microsoft Connect

I have a class library project for .NET 3.5 built with Visual Studio 2008.

If I try to NGEN the core assembly in this solution file, NGEN never completes, or at least not in the time I've bothered to let it run (like overnight).

Has anyone else experienced this? And if so, did you solve it? And if you did, how? What steps did you take?

If this is a bug in NGEN, how do I post this to Microsoft? I have a connect account, but where do I post a bug-report for this particular product, instead of a .NET class (which I know where to go for.)

The class library in question can be found here:

The problematic assembly is the LVK.Core assembly.

Update: NGEN for .NET 4.0 completed, but it took nearly 15 minutes to do so:

time /t
12:44:39
ngen install lvk.core.dll
Microsoft (R) CLR Native Image Generator - Version 4.0.30319.1
Copyright (c) Microsoft Corporation.  All rights reserved.
Installing assembly C:\Dev\VS.NET\LVK\LVK.Core\bin\x86\Debug\lvk.core.dll
    Compiling assembly C:\Dev\VS.NET\LVK\LVK.Core\bin\x86\Debug\lvk.core.dll (CLR v2.0.50727) ...
LVK.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=8dbb1dd9b1276c0a <debug>
time /t
12:59:24

Update #2: Created issue in Microsoft Connect.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

殊姿 2024-09-04 14:24:07

后来发现原因是我对 Tuple<...> 泛型类的实现。

事实证明,通过 NGEN 调用时,JIT 进程将为以下类型创建每个 Tuple<...> 类型的 NGEN 版本:

  1. 所有引用类型都有一个通用版本
  2. 每种类型都有一个版本值类型

由于我有最多 16 个通用参数的元组版本,为了更好地衡量,NGEN 忙于制作 Tuple< 的每个组合。 /code> 适用于所有值类型。

我将类型数量减少到更少的泛型参数,NGEN 现在已完成。

The reason for this was later found to be my implementation of Tuple<...> generic classes.

It turns out that the JIT process when invoked through NGEN will create NGEN'ed versions of each Tuple<...> type for the following types:

  1. One common version for all reference types
  2. One version for each value type

Since I had Tuple-versions up to 16 generic arguments, just for good measure, NGEN was busy churning out every combination there was for a Tuple<T1, T2, T3, T4, ..., T16> for all the value types.

I reduced the number of types down to a lot fewer generic arguments, and NGEN now completes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文