Click here to Skip to main content
Click here to Skip to main content

Tagged as

How to get FullType From AssemblyQualifiedName (remove Version, Culture and PublicKeyToken)

, 7 Oct 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
When this code ends, you'll get
"System.String, mscorlib"
instead of
"System.String, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089"

string typename = obj.GetType().AssemblyQualifiedName;
typename = Regex.Replace(typename, @", Version=\d+.\d+.\d+.\d+",string.Empty);
typename = Regex.Replace(typename, @", Culture=\w+", string.Empty);
typename = Regex.Replace(typename, @", PublicKeyToken=\w+", string.Empty);


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Pawel idzikowski
Software Developer (Senior) Polenter - Software Solutions
Germany Germany
I'm C# developer from Cologne, Germany. Here I owe a small software company. My hobby is general optimization - natural talent of all lazy guys Wink | ;-)

Comments and Discussions

GeneralAs it is about to known as off-topic, I deleted it. :) PinmemberHiren Solanki13-Oct-10 21:08 
GeneralWhat about more generally? i.e. "typing dark letters on a li... PinmemberPawel idzikowski13-Oct-10 8:17 
GeneralReason for my vote of 2 Just change the tip subject as 'Stri... PinmemberHiren Solanki13-Oct-10 4:40 
GeneralReason for my vote of 1 Too complicated PinmemberWhiteRose16117-Oct-10 18:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150123.1 | Last Updated 7 Oct 2010
Article Copyright 2010 by Pawel idzikowski
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid