簡體   English   中英

使用mkbundle2創建文件時,如何確定在Mono C#環境中執行的文件名?

[英]How can I determine the file name that is being executed in a mono C# environment when the file was created with mkbundle2?

當使用“ mono”命令在mono下運行C#應用程序時,以下工作有效:

var fileName = System.Reflection.Assembly.GetExecutingAssembly().Location;

但是,在使用mono的mkbundle2將程序集打包到單個文件中之后,上面的行沒有返回預期的結果。

哦,這行得通:

var fileName = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;

暫無
暫無

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

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