At my deployment to Azure Cloud WebRole the f:\approot\bin\MYPROJECT.Web.dll.config
file has:
<connectionStrings>
<add name="nsDbContext" providerName="System.Data.SqlClient" connectionString="Server=(localdb)\v11.0;Database=nsvDb.TestOnly;Integrated Security=True;" />
</connectionStrings>
At my project I have this.
"MYPROJECT.Web.csproj":
<Content Include="MYPROJECT.Web.dll.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<SubType>Designer</SubType>
</Content>
"MYPROJECT.Web.dll.config":
<connectionStrings>
<add name="nsDbContext" providerName="System.Data.SqlClient" connectionString="Server=tcp:*****.database.windows.net,***;Database=db;User ID=****;Password=****;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" />
</connectionStrings>
"Web.config":
<connectionStrings>
<add name="nsDbContext" providerName="System.Data.SqlClient" connectionString="Server=(localdb)\v11.0;Database=nsvDb.TestOnly;Integrated Security=True;" />
</connectionStrings>
"Web.Release.config":
<connectionStrings>
<add name="nsDbContext"
connectionString="Server=tcp:*****.database.windows.net,***;Database=db;User ID=****;Password=****;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;"
providerName="System.Data.SqlClient" xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />
</connectionStrings>
It is Azure Tools v2.9 installed. Visual Studio Community 2015 (14.0.24720).
Strangly enough when I build Release it places into my local bin\
the content of my web.config when MYPROJECT.Web.dll.config has CopyToOutputDirectory
.
How to set up connection string for WebRole deployed locally and deployed to the cloud? Now my configuration breaks because of the invalid connection string.
PS. I've asked similar question at FileLoadException: Could not load file or assembly in WebRole (recycling instance). But now it does not seem to work.