How to specify class type in app.config?

I am trying to figure out how to refer to a class in app.config. In this case, I want to configure the extension and the only Microsoft extension in app.config

<extension type="?, ?" />

Is it type="assemblyName, namespace.class"?

+4
source share
2 answers

You need to specify the fully qualified type name :

A valid type name consists of an assembly name specification, a namespace specification, and a type name.

Example:

"System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

In some cases, you just need “namespace name + assembly name”:

"System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework"
+5
source

I do not know what syntax Unity uses, however the standard syntax (for example, for configuration sections) Namespace1.Namespace2.ClassName, AssemblyName.

+1

All Articles