1
最近我創建了一個模塊來爲其他依賴於它的模塊安裝基本的東西。 我必須做一個web.config手動更改所有模塊的工作,我想知道是否有任何方式在模塊instalation進程中自動化它。模塊在安裝時是否可以在DNN web.config中添加一行?
最近我創建了一個模塊來爲其他依賴於它的模塊安裝基本的東西。 我必須做一個web.config手動更改所有模塊的工作,我想知道是否有任何方式在模塊instalation進程中自動化它。模塊在安裝時是否可以在DNN web.config中添加一行?
是的。在您的模塊的DNN Manifest文件中,您可以添加一個配置部分。
http://www.dnnsoftware.com/wiki/manifest-config-component
實施例:
<component type="Config">
<config>
<configFile>web.config</configFile>
<install>
<configuration>
<nodes>
<node path="/configuration/appSettings" action="update" key="key" collision="overwrite">
<add key="myCustomKey" value="123456789" />
</node>
</nodes>
</configuration>
</install>
<uninstall>
<configuration>
<node path="/configuration/appSettings/add[@key='myCustomKey']" action="remove" />
</configuration>
</uninstall>
</config>
</component>