簡體   English   中英

調試無法加載DLL“ MyDll.dll”:找不到指定的模塊。 (來自HRESULT的異常:0x8007007E)

[英]Debugging Unable to load DLL 'MyDll.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

我遇到了例外:

Unable to load DLL 'MyDll.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

正如“ 無法加載DLL(找不到模塊HRESULT:0x8007007E)”的答案所建議的那樣,我們希望將非托管dll及其所有托管dll保留在當前目錄中。 為了進行調試,我如何打印將用於加載dll的當前目錄? Directory.GetCurrentDirectory()嗎?

您可以使用Environment.CurrentDirectory來獲取應用程序的當前工作目錄。 這應該給您想要的。

Assembly.GetExecutingAssembly()。位置將返回包含當前執行的可執行文件或DLL的目錄。

currentDirectory所可以通過FileDialogs和其他類進行更改。 因此,它可能與包含應用程序入口點的目錄不同。

暫無
暫無

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

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