簡體   English   中英

使用NGEN創建的.NET本機映像未加載

[英].NET native images created with NGEN are not loaded

我已經使用NGEN來創建我的應用程序使用的幾個程序集的本機映像。 但是,運行應用程序時不會加載這些圖像,我不知道為什么。

這是來自fuslogvw的典型日志:

*** Assembly Binder Log Entry  (2/05/2012 @ 13:29:04) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable  C:\MyDir\MyApp.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = ***\***
LOG: DisplayName = MyAssembly, Version=1000.0.0.0, Culture=neutral, PublicKeyToken=null (Fully-specified)
LOG: Appbase = file:///C:/MyDir/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MyApp.exe
Calling assembly : PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: Start binding of native image MyAssembly, Version=1000.0.0.0, Culture=neutral, PublicKeyToken=null.
WRN: No matching native image found.
LOG: IL assembly loaded from C:\MyDir\MyAssembly.dll.

以及來自ngen.exe的有關該程序集的信息:

C:\MyDir>ngen display MyAssembly.dll
Microsoft (R) CLR Native Image Generator - Version 4.0.30319.1
Copyright (c) Microsoft Corporation.  All rights reserved.

NGEN Roots:

C:\MyDir\MyAssembly.dll

NGEN Roots that depend on "C:\MyDir\MyAssembly.dll":

C:\MyDir\MyAssembly.dll

Native Images:

MyAssembly, Version=1000.0.0.0, Culture=neutral, PublicKeyToken=null

我使用位於C:\\ Windows \\ Microsoft.NET \\ Framework \\ v4.0.30319 \\中的ngen.exe,我的程序集的目標框架是.NET Framework 4.我在創建本機映像后沒有重新編譯程序集。

任何幫助,將不勝感激。

程序集管理器從:C:\\ Windows \\ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ clr.dll加載

您的進程以64位模式運行,默認情況下是64位操作系統上的AnyCPU目標。 這要求您運行64位版本的ngen.exe。 請務必選擇正確的Visual Studio命令提示符。 有兩個,即為64位工具設置環境的工具在“開始”菜單中命名為“Visual Studio x64 Win64命令提示符(2010)”。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM