-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get startup path from assembly in Single Exe File #30448
Comments
I guess this is because it's basically embedding the DLL in a generated assembly and extracting it to a temp location before loading the DLL. Seems like it's a known issue; https://github.com/dotnet/coreclr/issues/20287#issuecomment-504287272 |
It's not an issue rather a breaking change if you come from .NET Framework and dot net team suggests to use GetModuleFileNameW API is Process.GetCurrent().Mainmodule.Filename. |
Yea, this is what I already did in my code. I created this issue because I wasn't sure the assembly location should be the execution file or extracted one. |
Well, you did ask for the location of the assembly containing |
I don't know is it a bug or not.
After I published my application using this command
dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true
I'm not able to get the correct startup address from the code below:The output is in the temp directory and it's dll file. Something like this:
C:\Users\MyUser\AppData\Local\Temp\.net\MyApp\po5w3wnz.iiu\MyApp.dll
The text was updated successfully, but these errors were encountered: