2017-02-16 36 views
0

我有一個.NET庫,它的dll即將放入GAC。一個控制檯應用程序正在使用此庫並定義自定義配置部分。但它拋出在是否有可能在GAC中使用程序集創建自定義配置部分

ConfigurationManager.getConfigSection("telemetry") 

它工作得很好,當庫DLL位於bin文件夾。但是從GAC訪問時會​​拋出異常。這是爲什麼發生。任何線索?有沒有什麼辦法解決這一問題。

我的配置部分定義爲 -

<configSections> 
<section name="telemetry" type="Com.Example.Telemetry.TelemetryConfig,Com.Example.Telemetry Version=1.0.0.0,Culture=neutral,PublicKeyToken=f0c3520fdea11a5a" /> 
</configSections> 
+0

之間用逗號你是如何定義在Web /應用程序配置的配置部分? –

回答

0

想通了這個問題。

失蹤組件的名稱和版本

<configSections> 
<section name="telemetry" type="Com.Example.Telemetry.TelemetryConfig,Com.Example.Telemetry, Version=1.0.0.0,Culture=neutral,PublicKeyToken=f0c3520fdea11a5a" /> 
</configSections> 
相關問題