我開發一個.NET 4的應用程序插件,我想一個配置文件添加到DLL,因爲我不想把配置在主配置文件。 我已經添加了app.config項目,它正確編譯並生成了dllName.dll.config。DLL配置文件(dllName.dll.config)
這裏是我的配置文件:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="MyTabsConfig" type="NewApp.UI.MyTabsConfigHandler, NewApp.UI" />
</configSections>
<MyTabsConfig>
<MyTabs>
<MyTab Name="First" Leads="2" />
<MyTab Name="Second" Leads="4" />
<MyTab Name="Third" Leads="1" />
</MyTabs>
</MyTabsConfig>
</configuration>
現在我有1個問題: 如果我複製我的主要應用程序的ExtraPlugins目錄中的文件,NewApp.UI.dll無法找到調用GetSection(當「MyTabsConfig」)。我認爲它在主應用程序文件夾中查找。
謝謝。
可能重複http://stackoverflow.com/questions/594298/c-sharp-dll-config-file – oleksii 2011-12-16 13:23:13