0
我收到以下錯誤:自定義配置節處理程序拋出異常
"An error occurred creating the configuration section handler for Config/Site1:
Could not load file or assembly Operations or one of its dependencies.
The system cannot find the file specified. (....vshost.exe.config line 9)
任何一個可以幫助?
這是我的app.config文件,如果有幫助:
...
<configSections>
<sectionGroup name="Config">
<section name="Sites" type="System.Configuration.SingleTagSectionHandler" />
<section name="Site1" type="Operations.Site1SectionHandler, Operations, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
allowLocation="true"
allowDefinition="Everywhere" />
</sectionGroup>
</configSections>
...
<Config>
<Sites Site1="mySite1" />
<Site1
Property1="Value1"
/>
</Config>
...
,這裏是我的聲明Site1SectionHandler(項目默認命名空間是行動):
Class Site1SectionHandler
Inherits ConfigurationSection
<ConfigurationProperty("Property1", IsRequired:=True)> _
Public ReadOnly Property Property1 As String
Get
Return Me("Property1")
End Get
End Property
End Class
而且我這是怎麼叫它併發生以下情況:
Dim mySite1 = ConfigurationManager.GetSection("Config/Site1")
不知道我是否缺少明顯的。 我最初嘗試沒有版本/文化/ ...等東西,但它沒有區別。