I\'m working with WPF and often have the need to get the namespace and assembly name of a given class. But I don\'t know how to do this.
So, how can we get the name
You can use F# interative, just open the window (View -> Other Windows -> F# Interactive) and try the following:
> typedefof.Assembly.FullName;;
val it : string =
"System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
There are a few assemblies referenced automatically like System. If you need to get the name from another assembly, you'll need to add the reference first (like the service model for example).
> #r "System.ServiceModel.dll";;
--> Referenced 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.ServiceModel.dll'
> typedefof.Assembly.FullName;;
val it : string =
"System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
F# interative is part of Visual Studio 2010.