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

When running a C# application under mono with the "mono " command, the following works: 当使用“ mono”命令在mono下运行C#应用程序时,以下工作有效:

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

But after packaging the assemblies into a single file using mono's mkbundle2, the line above does not return the expected result. 但是,在使用mono的mkbundle2将程序集打包到单个文件中之后,上面的行没有返回预期的结果。

哦,这行得通:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C#Cywgwin Mono Mkbundle Windows 7-无法编译文件 - c# cywgwin mono mkbundle windows 7 - cannot compile file 如何确定Visual Studio中C#文件的类型? - How can I determine the type of C# file in Visual Studio? 如何确定正在使用哪个C#设置文件 - How to Determine Which C# Settings File Is Being Used 如何确定是否正在从 zip 文件运行 C# 可执行文件? - How to determine if C# executable is being run from zip file? 我怎么知道何时创建进程并停止执行该进程或在Windows中终止该进程? - How can i know when a process is being created and stop it from being executed or terminated it in windows? Mono Mkbundle工具无法创建二进制文件,并抱怨输出文件不可用 - Mono mkbundle tool unable to create binary with complaint that output file is unavailable 如何在C#的路径中找到文件名? - How can I find the file name in a path in C#? 如何在C#中确定当前关注进程的名称 - How can I determine the name of the currently focused process in C# 有没有办法确定文件是否已在C#中执行? - Is there way to determine if a file has been executed or not in C#? 使用Mono的Mac上的mkbundle:找不到“mono / metadata / mono-config.h”文件 - mkbundle on Mac with Mono: “mono/metadata/mono-config.h” file not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM