Search code examples
asp.net.netweb-configwebdeployprecompile

Webdeploy - precompile asp.net application error with excluded connectionstrings in excluded app_data folder


I try to use webdeploy for our asp.net application. Today I tried to activate the "Precompile during publishing" flag. It seems that this flag doesn`t work together with the "Exclude files from the App_Data folder".

Before I activated the precompiling in webdeploy everything worked fine. If I remove the configSource from my connectionStrings and run the webdeploy with precompiling it works again.

The problem is that I have to load the external connectionstring file, because it will be managed by the administrators for production-environments.

The error message I get from webdeploy is:

"An error occurred loading a configuration file: Directory 'C:\MyProject\obj\Release\AspnetCompileMerge\Source\App_Data' does not exist. Failed to start monitoring file changes."

My current setup is the following: Web.Config:

<configuration>
  <!-- Section stuff here -->
  <connectionStrings configSource="App_Data\DBConnection.xml" />
  <!-- More stuff here -->
</configuration>

New webdeploy settings: enter image description here enter image description here


Solution

  • Hey this did not work for us. But we also updated our tfs in the last days and we had a look into the webdeploy parameters which can be set easily with the release Manager from our new tfs. So we just readded he connectionstrings into the web.config and than we compile everything. In the end we decided where it's going to be deployed and than we set automatically the connectionstrings, which are hidden for us Devs.