WebMay 8, 2009 · GetExecutingAssembly returns assembly that contains the code that is currently executing. This may not necessarily be the console .exe assembly. It may be an assembly that has been loaded from a totally different location. You will have to use GetEntryAssembly! Also note that CodeBase might not be set when the assembly is in …
c# - Get current folder path - Stack Overflow
WebFeb 9, 2012 · The trick to get the EXE path is to pass NULL as the hModule parameter. From MSDN: hModule [in, optional] A handle to the loaded module whose path is being requested. If this parameter is NULL, GetModuleFileName retrieves the path of the executable file of the current process. Share Improve this answer Follow answered Feb … WebTwo options... regardless of application type you can always invoke: Assembly.GetExecutingAssembly().GetName().Version If a Windows Forms application, you can always access via application if looking specifically for product version.. Application.ProductVersion uncontested divorce forms in georgia
What
WebJul 5, 2013 · If you want the executable: System.Reflection.Assembly.GetEntryAssembly ().Location If you want the assembly that's consuming your library (which could be the same assembly as above, if your code is called directly from a class within your executable): System.Reflection.Assembly.GetCallingAssembly ().Location WebHow to find the .NET executable's path and directory. Find the executable's path and its directory by using System.Reflection.Assembly.GetExecutingAssembly ().Location. This … WebSep 10, 2013 · By contrast, appBaseDir and path get the directory which contains the executing assembly’s file. To illustrate how they differ, consider that you have an executable which sits in C:\bar\baz.exe. Now I can execute the application by entering the following chain of commands in a terminal: $ md C:\foo $ cd C:\foo $ ..\bar\baz.exe thorsten jamrath