Writing a .NET DLL how do I find Application.ProductName
?
EDIT:
Obviously, importing Windows.Forms
could solve the problem, but my DLL have nothing to do with Windows Forms.
Writing a .NET DLL how do I find Application.ProductName
?
EDIT:
Obviously, importing Windows.Forms
could solve the problem, but my DLL have nothing to do with Windows Forms.
Tested in C#. Should be fine in VB at least.. not sure about c++
System.Windows.Forms.Application.ProductName
The Application
class just needs a reference to System.Window.Forms
. So the simpler way is to add that reference in your *.dll and use the property.
However if you are not allowed to reference the Windows Forms library you can somewhat replicate the functionality in a custom class of yours and read the AssemblyProductAttribute from the assembly you consider to be your application. For a console application you would consider the assembly returned from Assembly.GetEntryAssembly
to be your application.