繁体   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