Skip to content
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

Use Assembly name in .Net Core #8

Open
bitchkat opened this issue May 24, 2018 · 1 comment
Open

Use Assembly name in .Net Core #8

bitchkat opened this issue May 24, 2018 · 1 comment

Comments

@bitchkat
Copy link

In .Net core apps, they are typically run via "dotnet MyProgram.dll". This means the program name will always use "dotnet" as the program name. It would be really handy if this could be detected and the name of the actual .net core console app could be used.

I hacked up some local mods to effect these changes. Effectively, if the process name is "dotnet" I retrieve the entity dotnet is executing via

System.Reflection.Assembly.GetEntryAssembly().GetName().Name;

As it turns out, .Net standard 1.3 doesn't have the GetEntryAssembly() method, so I modified the project to add a .Net Standard 2.0 to the frameworks and conditionally compile the code above on .NetStandard 2.0.

My visual studio 2017 did some migration on the project so I'll include the csproj file that resulted from that since that is where I had to set up the .Net Standard 2.0 build.
dotnetcore-process-name.patch.txt

@Numpsy
Copy link
Member

Numpsy commented Dec 16, 2020

Would this be considered a reasonable feature to have then? (the other changes to the project and targets and such in the attached patch should have already been done now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants