Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why is this so long winded to get AssemblyInfo? 1

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hi,

Is this really the only way to access AssemblyInfo details?

Code:
Assembly.GetEntryAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false).Cast<AssemblyProductAttribute>().FirstOrDefault().Product

This seems ridiculously complicated to get some simple information about my application.

Thanks,

1DMF

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
 
Such is life!!

The AssemblyInfo details are so that you can see something about your assembly in windows.
It is a compiled class so the only way to see it is via reflection.

If you want to be able to access this frequently in a more user friendly manner then just write yourself a static class which does the work.

Do you want some custom SIM scripts developed. Contact me via my website
 
Hi CathalMF,

Good to know I wasn't beating around the bush, when there was a more direct approach.

I've written a helper static class to manage version control utilising the AssemblyInfo, so I won't need to keep writing such code.

Thanks for input, it's appreciated.

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top