问题描述
我有一个类库项目面向.NET 3.5使用Visual Studio 2008的。
I have a class library project for .NET 3.5 built with Visual Studio 2008.
如果我尝试NGEN的核心组件,该解决方案文件,NGEN无法完成,或者至少在的时候,我已经不屑于让它运行(如隔夜)。
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?
如果这是NGEN的错误,我怎么张贴此为微软?我有一个连接帐户,但我在哪里发布错误报告对这个特殊的产品,而不是.NET类(我知道去哪里了。)
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:
- http://svn.vkarlsen.no:81/svn/LVK/LVK_3_5/trunk (subversion 1.6 repository)
有问题的组件是LVK.Core组装。
The problematic assembly is the LVK.Core assembly.
更新:NGEN的.NET 4.0完成,但花了近15分钟,这样做的:
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
更新#2:创建于 Microsoft连接。
推荐答案
这样做的原因是后来才发现是我的执行的元组LT; ...&GT;
通用类。
The reason for this was later found to be my implementation of Tuple<...>
generic classes.
事实证明,当通过NGEN调用JIT过程将创建NGEN'ed每个版本的元组LT; ...&GT;
键入以下几种类型:
It turns out that the JIT process when invoked through NGEN will create NGEN'ed versions of each Tuple<...>
type for the following types:
- 在其中普通版的所有引用类型
- 在其中一个版本为每个值类型
因为我有元组的版本多达16个通用的参数,只是为了好措施,NGEN忙于搅动了每个组合有一个元组LT; T1,T2,T3,T4,... ,T16&GT;
所有的值类型
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.
我减少类型的数量下降到少了很多通用的参数,NGEN现在完成了。
I reduced the number of types down to a lot fewer generic arguments, and NGEN now completes.
这篇关于任何理由NGEN应该挂并且永远不会完成一个特定的程序集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!