WebOct 5, 2012 · GetEntryAssembly for web applications There is class library which gets its executing assembly location by calling GetEntryAssembly (). However using that class library in ASP.NET web application that function returns null. Is it possible to get location of ASP.NET application executable from class library which it calls? 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
What
WebAug 6, 2024 · 2 We have a API Real Application which is running following code to get the Assembly Directory. Assembly.GetEntryAssembly ().Location Result: C:\\OriginalApplicationAPI\\bin\\Debug\\netcoreapp2.2 Now we are running an Integration Xunit project, which is running the Startup, appsettings, etc from the original project. WebSep 10, 2013 · They all give the same result. They certainly don’t. currentDir and dir both give you the current working directory – i.e. by default the directory your executable was run from (but it can be changed during the execution).. By contrast, appBaseDir and path get the directory which contains the executing assembly’s file. To illustrate how they differ, … theories of group processes
c# - get path for my .exe - Stack Overflow
WebYou can adjust your file with his path var path = Assembly.GetAssembly (MyType.GetType ()).Location; var thisAssembly= Assembly.LoadFrom (path); var TypeName = ""; Type type = thisAssembly.GetType (TypeName); object instance = Activator.CreateInstance (type); Share Improve this answer Follow edited Jan 8, 2015 at 10:32 Bellash 7,379 6 51 84 WebAssembly.CodeBase To get the absolute path to the loaded manifest-containing file, use the Assembly.Location property instead. If the assembly was loaded as a byte array, using an overload of the Load method that takes an array of bytes, this property returns the location of the caller of the method, not the location of the loaded assembly. WebJan 14, 2015 · So here is a quick method that you can use to return the directory of the current executable that takes the URI into account: public static DirectoryInfo GetExecutingDirectory () { var location = new Uri (Assembly.GetEntryAssembly ().GetName ().CodeBase); return new FileInfo (location.AbsolutePath).Directory; } theories of health behaviour