Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the fully qualified name of a class?

All, I have a log4net implementation and I'm trying to use the AdoNetAppender, but one of the subelements for the appender configuration is connectionType and it requires a fully qualified class name like System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (got that from the documentation as an example).

However, it can't load that one because this is a .NET4 MVC application. Can somebody tell me how I can get that fully qualified name so it will load the type and connect to the database? I've tried everything that I can honestly think of.

like image 335
Mike Perrenoud Avatar asked Nov 03 '12 00:11

Mike Perrenoud


1 Answers

I'm not sure what type you need, but you can use this in code to get the fully qualified name of a type.

string fullyQualifiedName = typeof(MyType).AssemblyQualifiedName;
like image 173
TylerOhlsen Avatar answered Sep 27 '22 19:09

TylerOhlsen