Finding an assembly after installing in the GAC.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I recently installed an assembly in the GAC and now I am having some trouble
finding it. This assembly defines some TraceListeners that I am using for
logging in our app. The application configuration file contains the following
lines the assembly is ErrorLog:

<trace autoflush="true" indentsize="4">
<listeners>
<add name="debugOut" type="System.Diagnostics.DefaultTraceListener" />
<add name="consoleOut" type="visa.dps.ppc.DynamicFileTraceListener,
ErrorLog" initializeData="ApplicationServer.log" />
<add name="eventOut" type="visa.dps.ppc.EventTraceListener,
ErrorLog" />
<remove name="debugOut" />
</listeners>
</trace>

I look in the GAC and I see

ErrorLog, Version=2.5.4.0, Culture=neutral, PublicKeyToken=33fcdc7f7eb6be4b,
Custom=null

When I run one of my apps that has a configuration file that contains the
lines above, I get:

Configuration exception during setup: Couldn't find type for class
visa.dps.ppc.DynamicFileTraceListener, ErrorLog.
at
System.Diagnostics.DiagnosticsConfigurationHandler.HandleListeners(Hashtable
config, XmlNode listenersNode, Object context)
at
System.Diagnostics.DiagnosticsConfigurationHandler.HandleTrace(Hashtable
config, XmlNode traceNode, Object context)
at System.Diagnostics.DiagnosticsConfigurationHandler.Create(Object
parent, Object configContext, XmlNode section)
at
System.Configuration.ConfigurationRecord.EvaluateRecursive(IConfigurationSectionHandler
factory, Object config, String[] keys, Int32 iKey, XmlTextReader reader)
at System.Configuration.ConfigurationRecord.Evaluate(String configKey)
at System.Configuration.ConfigurationRecord.ResolveConfig(String configKey)
at System.Configuration.ConfigurationRecord.GetConfig(String configKey)
at
System.Configuration.DefaultConfigurationSystem.System.Configuration.IConfigurationSystem.GetConfig(String configKey)
at System.Configuration.ConfigurationSettings.GetConfig(String sectionName)
at System.Diagnostics.DiagnosticsConfiguration.GetConfigTable()
at System.Diagnostics.DiagnosticsConfiguration.Initialize()
at System.Diagnostics.DiagnosticsConfiguration.get_SwitchSettings()
at System.Diagnostics.Switch.Initialize()
at System.Diagnostics.Switch.get_SwitchSetting()
at System.Diagnostics.BooleanSwitch.get_Enabled()
at System.Xml.Serialization.Compiler.Compile()
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
mappings)
at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
at visa.dps.ppc.ivr.IVRService..ctor()
at visa.dps.ppc.InstallTestForm..ctor()
----------

Any idea as to what I am doing wrong?

Thank you.

Kevin Burton
 
The TraceListener or the class that is derived from TraceListener is in the
ErrorLog assembly and that as I have indicated is in the GAC. I have verified
this. It seems that the process that parses the configuration file uses a
different algorithm to find an assembly than "normal" it does not seem to be
looking in the GAC for the assembly. Any ideas on how to force the
configuration to look in the GAC?

Thanks again.

Kevin

Kevin Burton said:
I recently installed an assembly in the GAC and now I am having some trouble
finding it. This assembly defines some TraceListeners that I am using for
logging in our app. The application configuration file contains the following
lines the assembly is ErrorLog:

<trace autoflush="true" indentsize="4">
<listeners>
<add name="debugOut" type="System.Diagnostics.DefaultTraceListener" />
<add name="consoleOut" type="visa.dps.ppc.DynamicFileTraceListener,
ErrorLog" initializeData="ApplicationServer.log" />
<add name="eventOut" type="visa.dps.ppc.EventTraceListener,
ErrorLog" />
<remove name="debugOut" />
</listeners>
</trace>

I look in the GAC and I see

ErrorLog, Version=2.5.4.0, Culture=neutral, PublicKeyToken=33fcdc7f7eb6be4b,
Custom=null

When I run one of my apps that has a configuration file that contains the
lines above, I get:

Configuration exception during setup: Couldn't find type for class
visa.dps.ppc.DynamicFileTraceListener, ErrorLog.
at
System.Diagnostics.DiagnosticsConfigurationHandler.HandleListeners(Hashtable
config, XmlNode listenersNode, Object context)
at
System.Diagnostics.DiagnosticsConfigurationHandler.HandleTrace(Hashtable
config, XmlNode traceNode, Object context)
at System.Diagnostics.DiagnosticsConfigurationHandler.Create(Object
parent, Object configContext, XmlNode section)
at
System.Configuration.ConfigurationRecord.EvaluateRecursive(IConfigurationSectionHandler
factory, Object config, String[] keys, Int32 iKey, XmlTextReader reader)
at System.Configuration.ConfigurationRecord.Evaluate(String configKey)
at System.Configuration.ConfigurationRecord.ResolveConfig(String configKey)
at System.Configuration.ConfigurationRecord.GetConfig(String configKey)
at
System.Configuration.DefaultConfigurationSystem.System.Configuration.IConfigurationSystem.GetConfig(String configKey)
at System.Configuration.ConfigurationSettings.GetConfig(String sectionName)
at System.Diagnostics.DiagnosticsConfiguration.GetConfigTable()
at System.Diagnostics.DiagnosticsConfiguration.Initialize()
at System.Diagnostics.DiagnosticsConfiguration.get_SwitchSettings()
at System.Diagnostics.Switch.Initialize()
at System.Diagnostics.Switch.get_SwitchSetting()
at System.Diagnostics.BooleanSwitch.get_Enabled()
at System.Xml.Serialization.Compiler.Compile()
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
mappings)
at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
at visa.dps.ppc.ivr.IVRService..ctor()
at visa.dps.ppc.InstallTestForm..ctor()
----------

Any idea as to what I am doing wrong?

Thank you.

Kevin Burton
 
Hello Kevin,

When looking for an assembly in the GAC, you need to specify a version and
public key as part of the type. This is because you can have different versions
and the CLR needs to know which version to load.

--
Matt Berther
http://www.mattberther.com
The TraceListener or the class that is derived from TraceListener is
in the ErrorLog assembly and that as I have indicated is in the GAC.
I have verified this. It seems that the process that parses the
configuration file uses a different algorithm to find an assembly
than "normal" it does not seem to be looking in the GAC for the
assembly. Any ideas on how to force the configuration to look in the
GAC?

Thanks again.

Kevin

Kevin Burton said:
I recently installed an assembly in the GAC and now I am having some
trouble finding it. This assembly defines some TraceListeners that I
am using for logging in our app. The application configuration file
contains the following lines the assembly is ErrorLog:

<trace autoflush="true" indentsize="4">
<listeners>
<add name="debugOut" type="System.Diagnostics.DefaultTraceListener"
/>
<add name="consoleOut" type="visa.dps.ppc.DynamicFileTraceListener,
ErrorLog" initializeData="ApplicationServer.log" />
<add name="eventOut" type="visa.dps.ppc.EventTraceListener,
ErrorLog" />
<remove name="debugOut" />
</listeners>
</trace>
I look in the GAC and I see

ErrorLog, Version=2.5.4.0, Culture=neutral,
PublicKeyToken=33fcdc7f7eb6be4b, Custom=null

When I run one of my apps that has a configuration file that contains
the lines above, I get:

Configuration exception during setup: Couldn't find type for class

visa.dps.ppc.DynamicFileTraceListener, ErrorLog.

at

System.Diagnostics.DiagnosticsConfigurationHandler.HandleListeners(Ha
shtable

config, XmlNode listenersNode, Object context)

at

System.Diagnostics.DiagnosticsConfigurationHandler.HandleTrace(Hashta
ble

config, XmlNode traceNode, Object context)

at System.Diagnostics.DiagnosticsConfigurationHandler.Create(Object

parent, Object configContext, XmlNode section)

at

System.Configuration.ConfigurationRecord.EvaluateRecursive(IConfigura
tionSectionHandler

factory, Object config, String[] keys, Int32 iKey, XmlTextReader
reader)

at System.Configuration.ConfigurationRecord.Evaluate(String
configKey)

at System.Configuration.ConfigurationRecord.ResolveConfig(String
configKey)

at System.Configuration.ConfigurationRecord.GetConfig(String
configKey)

at

System.Configuration.DefaultConfigurationSystem.System.Configuration.
IConfigurationSystem.GetConfig(String configKey)

at System.Configuration.ConfigurationSettings.GetConfig(String
sectionName)

at System.Diagnostics.DiagnosticsConfiguration.GetConfigTable()

at System.Diagnostics.DiagnosticsConfiguration.Initialize()

at System.Diagnostics.DiagnosticsConfiguration.get_SwitchSettings()

at System.Diagnostics.Switch.Initialize()

at System.Diagnostics.Switch.get_SwitchSetting()

at System.Diagnostics.BooleanSwitch.get_Enabled()

at System.Xml.Serialization.Compiler.Compile()

at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[]
xmlMappings)

at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]

mappings)

at System.Web.Services.Protocols.SoapClientType..ctor(Type type)

at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()

at visa.dps.ppc.ivr.IVRService..ctor()

at visa.dps.ppc.InstallTestForm..ctor()

----------

Any idea as to what I am doing wrong?

Thank you.

Kevin Burton
 
Matt,

First, thank you for your reply.

I tried adding a version and public key token and I get the same error which
I have copied below.

Any more suggestions.

Kevin

Configuration exception during setup: Couldn't find type for class
visa.dps.ppc.DynamicFileTraceListener, ErrorLog, Version=2.5.4.0,
PublicKeyToken=33fcdc7f7eb6be4b.
at
System.Diagnostics.DiagnosticsConfigurationHandler.HandleListeners(Hashtable
config, XmlNode listenersNode, Object context)
at
System.Diagnostics.DiagnosticsConfigurationHandler.HandleTrace(Hashtable
config, XmlNode traceNode, Object context)
at System.Diagnostics.DiagnosticsConfigurationHandler.Create(Object
parent, Object configContext, XmlNode section)
at
System.Configuration.ConfigurationRecord.EvaluateRecursive(IConfigurationSectionHandler
factory, Object config, String[] keys, Int32 iKey, XmlTextReader reader)
at System.Configuration.ConfigurationRecord.Evaluate(String configKey)
at System.Configuration.ConfigurationRecord.ResolveConfig(String configKey)
at System.Configuration.ConfigurationRecord.GetConfig(String configKey)
at
System.Configuration.DefaultConfigurationSystem.System.Configuration.IConfigurationSystem.GetConfig(String configKey)
at System.Configuration.ConfigurationSettings.GetConfig(String sectionName)
at System.Diagnostics.DiagnosticsConfiguration.GetConfigTable()
at System.Diagnostics.DiagnosticsConfiguration.Initialize()
at System.Diagnostics.DiagnosticsConfiguration.get_SwitchSettings()
at System.Diagnostics.Switch.Initialize()
at System.Diagnostics.Switch.get_SwitchSetting()
at System.Diagnostics.BooleanSwitch.get_Enabled()
at System.Xml.Serialization.Compiler.Compile()
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
mappings)
at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
at visa.dps.ppc.ivr.IVRService..ctor()
at visa.dps.ppc.InstallTestForm..ctor()
----------


Matt Berther said:
Hello Kevin,

When looking for an assembly in the GAC, you need to specify a version and
public key as part of the type. This is because you can have different versions
and the CLR needs to know which version to load.

--
Matt Berther
http://www.mattberther.com
The TraceListener or the class that is derived from TraceListener is
in the ErrorLog assembly and that as I have indicated is in the GAC.
I have verified this. It seems that the process that parses the
configuration file uses a different algorithm to find an assembly
than "normal" it does not seem to be looking in the GAC for the
assembly. Any ideas on how to force the configuration to look in the
GAC?

Thanks again.

Kevin

Kevin Burton said:
I recently installed an assembly in the GAC and now I am having some
trouble finding it. This assembly defines some TraceListeners that I
am using for logging in our app. The application configuration file
contains the following lines the assembly is ErrorLog:

<trace autoflush="true" indentsize="4">
<listeners>
<add name="debugOut" type="System.Diagnostics.DefaultTraceListener"
/>
<add name="consoleOut" type="visa.dps.ppc.DynamicFileTraceListener,
ErrorLog" initializeData="ApplicationServer.log" />
<add name="eventOut" type="visa.dps.ppc.EventTraceListener,
ErrorLog" />
<remove name="debugOut" />
</listeners>
</trace>
I look in the GAC and I see

ErrorLog, Version=2.5.4.0, Culture=neutral,
PublicKeyToken=33fcdc7f7eb6be4b, Custom=null

When I run one of my apps that has a configuration file that contains
the lines above, I get:

Configuration exception during setup: Couldn't find type for class

visa.dps.ppc.DynamicFileTraceListener, ErrorLog.

at

System.Diagnostics.DiagnosticsConfigurationHandler.HandleListeners(Ha
shtable

config, XmlNode listenersNode, Object context)

at

System.Diagnostics.DiagnosticsConfigurationHandler.HandleTrace(Hashta
ble

config, XmlNode traceNode, Object context)

at System.Diagnostics.DiagnosticsConfigurationHandler.Create(Object

parent, Object configContext, XmlNode section)

at

System.Configuration.ConfigurationRecord.EvaluateRecursive(IConfigura
tionSectionHandler

factory, Object config, String[] keys, Int32 iKey, XmlTextReader
reader)

at System.Configuration.ConfigurationRecord.Evaluate(String
configKey)

at System.Configuration.ConfigurationRecord.ResolveConfig(String
configKey)

at System.Configuration.ConfigurationRecord.GetConfig(String
configKey)

at

System.Configuration.DefaultConfigurationSystem.System.Configuration.
IConfigurationSystem.GetConfig(String configKey)

at System.Configuration.ConfigurationSettings.GetConfig(String
sectionName)

at System.Diagnostics.DiagnosticsConfiguration.GetConfigTable()

at System.Diagnostics.DiagnosticsConfiguration.Initialize()

at System.Diagnostics.DiagnosticsConfiguration.get_SwitchSettings()

at System.Diagnostics.Switch.Initialize()

at System.Diagnostics.Switch.get_SwitchSetting()

at System.Diagnostics.BooleanSwitch.get_Enabled()

at System.Xml.Serialization.Compiler.Compile()

at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[]
xmlMappings)

at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]

mappings)

at System.Web.Services.Protocols.SoapClientType..ctor(Type type)

at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()

at visa.dps.ppc.ivr.IVRService..ctor()

at visa.dps.ppc.InstallTestForm..ctor()

----------

Any idea as to what I am doing wrong?

Thank you.

Kevin Burton
 
Hello Kevin,

What I was getting to was that you needed to provide a fully qualified
assembly name...
This includes culture info.

So, try modifying your type attribute to be:

visa.dps.ppc.DynamicFileTraceListener, ErrorLog, Version=2.5.4.0,
Culture=neutral,PublicKeyToken=33fcdc7f7eb6be4b

--
Matt Berther
http://www.mattberther.com
Matt,

First, thank you for your reply.

I tried adding a version and public key token and I get the same error
which I have copied below.

Any more suggestions.

Kevin

Configuration exception during setup: Couldn't find type for class
visa.dps.ppc.DynamicFileTraceListener, ErrorLog, Version=2.5.4.0,
PublicKeyToken=33fcdc7f7eb6be4b.
at
System.Diagnostics.DiagnosticsConfigurationHandler.HandleListeners(Has
htable
config, XmlNode listenersNode, Object context)
at
System.Diagnostics.DiagnosticsConfigurationHandler.HandleTrace(Hashtab
le
config, XmlNode traceNode, Object context)
at System.Diagnostics.DiagnosticsConfigurationHandler.Create(Object
parent, Object configContext, XmlNode section)
at
System.Configuration.ConfigurationRecord.EvaluateRecursive(IConfigurat
ionSectionHandler
factory, Object config, String[] keys, Int32 iKey, XmlTextReader
reader)
at System.Configuration.ConfigurationRecord.Evaluate(String
configKey)
at System.Configuration.ConfigurationRecord.ResolveConfig(String
configKey)
at System.Configuration.ConfigurationRecord.GetConfig(String
configKey)
at
System.Configuration.DefaultConfigurationSystem.System.Configuration.I
ConfigurationSystem.GetConfig(String configKey)
at System.Configuration.ConfigurationSettings.GetConfig(String
sectionName)
at System.Diagnostics.DiagnosticsConfiguration.GetConfigTable()
at System.Diagnostics.DiagnosticsConfiguration.Initialize()
at System.Diagnostics.DiagnosticsConfiguration.get_SwitchSettings()
at System.Diagnostics.Switch.Initialize()
at System.Diagnostics.Switch.get_SwitchSetting()
at System.Diagnostics.BooleanSwitch.get_Enabled()
at System.Xml.Serialization.Compiler.Compile()
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[]
xmlMappings)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
mappings)
at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
at visa.dps.ppc.ivr.IVRService..ctor()
at visa.dps.ppc.InstallTestForm..ctor()
----------
Matt Berther said:
Hello Kevin,

When looking for an assembly in the GAC, you need to specify a
version and public key as part of the type. This is because you can
have different versions and the CLR needs to know which version to
load.

--
Matt Berther
http://www.mattberther.com
The TraceListener or the class that is derived from TraceListener is
in the ErrorLog assembly and that as I have indicated is in the
GAC. I have verified this. It seems that the process that parses
the configuration file uses a different algorithm to find an
assembly than "normal" it does not seem to be looking in the GAC
for the assembly. Any ideas on how to force the configuration to
look in the GAC?

Thanks again.

Kevin

:

I recently installed an assembly in the GAC and now I am having
some trouble finding it. This assembly defines some TraceListeners
that I am using for logging in our app. The application
configuration file contains the following lines the assembly is
ErrorLog:

<trace autoflush="true" indentsize="4">
<listeners>
<add name="debugOut" type="System.Diagnostics.DefaultTraceListener"
/>
<add name="consoleOut" type="visa.dps.ppc.DynamicFileTraceListener,
ErrorLog" initializeData="ApplicationServer.log" />
<add name="eventOut" type="visa.dps.ppc.EventTraceListener,
ErrorLog" />
<remove name="debugOut" />
</listeners>
</trace>
I look in the GAC and I see
ErrorLog, Version=2.5.4.0, Culture=neutral,
PublicKeyToken=33fcdc7f7eb6be4b, Custom=null
When I run one of my apps that has a configuration file that
contains the lines above, I get:

Configuration exception during setup: Couldn't find type for class

visa.dps.ppc.DynamicFileTraceListener, ErrorLog.

at

System.Diagnostics.DiagnosticsConfigurationHandler.HandleListeners(
Ha shtable

config, XmlNode listenersNode, Object context)

at

System.Diagnostics.DiagnosticsConfigurationHandler.HandleTrace(Hash
ta ble

config, XmlNode traceNode, Object context)

at System.Diagnostics.DiagnosticsConfigurationHandler.Create(Object

parent, Object configContext, XmlNode section)

at

System.Configuration.ConfigurationRecord.EvaluateRecursive(IConfigu
ra tionSectionHandler

factory, Object config, String[] keys, Int32 iKey, XmlTextReader
reader)

at System.Configuration.ConfigurationRecord.Evaluate(String
configKey)

at System.Configuration.ConfigurationRecord.ResolveConfig(String
configKey)

at System.Configuration.ConfigurationRecord.GetConfig(String
configKey)

at

System.Configuration.DefaultConfigurationSystem.System.Configuratio
n. IConfigurationSystem.GetConfig(String configKey)

at System.Configuration.ConfigurationSettings.GetConfig(String
sectionName)

at System.Diagnostics.DiagnosticsConfiguration.GetConfigTable()

at System.Diagnostics.DiagnosticsConfiguration.Initialize()

at System.Diagnostics.DiagnosticsConfiguration.get_SwitchSettings()

at System.Diagnostics.Switch.Initialize()

at System.Diagnostics.Switch.get_SwitchSetting()

at System.Diagnostics.BooleanSwitch.get_Enabled()

at System.Xml.Serialization.Compiler.Compile()

at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[]
xmlMappings)

at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]

mappings)

at System.Web.Services.Protocols.SoapClientType..ctor(Type type)

at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()

at visa.dps.ppc.ivr.IVRService..ctor()

at visa.dps.ppc.InstallTestForm..ctor()

----------

Any idea as to what I am doing wrong?

Thank you.

Kevin Burton
 
Back
Top