Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Get Startup Project's Assembly Name

Some background: I have a project which collects all the diagnostics (trace source) information from the other projects within my solution. I needed a way to get the main project name so that I could give the dump file a proper unique name.

The issue: I could not find a clear-cut answer on how to obtain the startup project's assembly name until I ran into this blog entry: http://weblog.west-wind.com/posts/2009/Jun/09/Getting-the-Apps-Startup-Assembly-in-WPF-Designer

like image 568
Kashif Avatar asked Dec 11 '22 00:12

Kashif


1 Answers

To get the name of the startup project, use:

string ProjectName = System.Reflection.Assembly.GetEntryAssembly().GetName().Name;
like image 113
Kashif Avatar answered Dec 31 '22 21:12

Kashif