4

I'm working on a project with 2 web applications, one being hosted as long running process (with appfabric), the other is just a normal MVC application. They share same datacontext, thus same connectionString. The appfabric application is deployed as a child application of the main, taking advantage of the web.config inheritance (we don't want connectionstring to be duplicated in web config)

My problem is that with the new Visual Studio 2012 wizard for publishing, the connectionString are automatically added, even when I untick the "Use this connection string at runtime" box.

I also try to use web config transform like this:

  <connectionStrings>
      <add xdt:Transform="RemoveAll" />
  </connectionStrings>

But connection string are still on my web config after publishing.

Any suggestions ? I'm thinking about removing completely the web config for that child application but it's not ideal.

Etienne
  • 1,058
  • 11
  • 22
  • Are any of the other transforms being applied? Are all of them being skipped, or just this one? – Heather Feb 13 '13 at 23:48
  • 1
    You're putting the transform logic in the Web.config.Release (assuming that you publish in a configuration named "Release"), right? – Middas Feb 13 '13 at 23:49
  • Yes to both of you. Using Release and transform is applied: e.g. the following is applied fine – Etienne Feb 14 '13 at 00:03
  • I can't say exactly what you need to do, but when I was troubleshooting transform issues in one of my projects, [this tool](http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5) was very helpful. It allowed me to preview the results of a transform so I could make changes and immediately see the impact. – Brian S Feb 14 '13 at 02:54
  • I'm gonna try a shot at microsoft forums because for me it sounds like a bug in their publish wizard. My guess is that thei publish wizards applies config transform first and then puts all the connectionString corresponding to any datacontext used in the project. – Etienne Feb 14 '13 at 03:08

1 Answers1

5

answer can be found here: Web Deploy / Publish is adding a unknown connection string?

Add this project property to the .csproj file by editing the XML:

<Project>
    <PropertyGroup>

         <AutoParameterizationWebConfigConnectionStrings>false</AutoParameterizationWebConfigConnectionStrings>

   ...
    </PropertyGroup>
...
</Project>
Community
  • 1
  • 1
Etienne
  • 1,058
  • 11
  • 22