I'm trying to get the project name via code (TestGetAssemblyName):

I've tried System.Reflection.Assembly.GetExecutingAssembly().GetName().Name but this returns some weird jumble of characters, looks dynamically generated. Is there a way to get TestGetAssemblyName returned to me via code?
What you read in Solution Explorer is completely unrelated to compiled assembly name or assembly title. Moreover it won't be written anywhere in your compiled assembly so you can't access that name from code.
Assuming
MyTypeis a type defined in your assembly you can useAssemblyTitleAttributeattribute (usually defined inAssemblyInfo.cs) to read given title (unrelated to compiled assembly name or code namespace):This (
AssemblyTitleAttribute) is just one of the attributes defined inAssemblyInfo.cs, pick the one that best fit your requirement.On the other way you may use assembly name (
Nameproperty fromAssembly) to get compiled assembly name (again this may be different from assembly title and from project title too).EDIT
To make it single line you have to put it (of course!) somewhere in your code:
To be used as: