2

I have one web application and virtual application in Azure. They are separate projects in VS2010 and I have added them to one solution with one Azure deployment project.

I have created multiple web.configs to control parameters, ie web.debug.config etc.

When I publish to azure I specify debug which works for the main application but the virtual application is pointing to the web.config not the variants. How do I correct this please?

Many Thanks, Steve.

Steve Newton
  • 1,046
  • 1
  • 11
  • 28

2 Answers2

0

Web application always uses web.config. If you want to use debug / release versions you have to create web.config Transformation. In this case web.config is transformed at build time using selected build target.

Matej
  • 7,517
  • 2
  • 36
  • 45
  • I have created the transformations but it is ignored for the virtual app, the main app does pay attention ot the build target. Thanks for replying though. – Steve Newton Feb 08 '12 at 21:01
0

Solution

The solution that worked for me from http://blog.hill-it.be/2011/03/07/no-web-config-transformation-in-local-azure/:

To fix this, unload your Azure project, open the project file for edit and add the tag [under the corresponding PropertyGroup]:

<Project ...>    
    <PropertyGroup>
      ...
          <packagewebrole>true</packagewebrole>

Workaround

There's also a workaround, it will work for a local development, but not for continuous integration (or at least you will have to find another trick).

  1. In your service definition file add a new Site section:
<Site name="AnotherSite" physicalDirectory="c:\AnotherSite">
  <Bindings>
    <Binding name="APIEndpoint" endpointName="AnotherSiteEndpoint" />
  </Bindings>
</Site>
  1. Add a new endpoint to match the code above (any port works):
<InputEndpoint name="AnotherSiteEndpoint" protocol="http" port="623" />
  1. Go to your web-project --> right-click --> Publish... --> FTP --> Location = "c:\AnotherSite"

  2. Press F5 and go to http://127.0.0.1:623

It should work.

Nikita R.
  • 7,245
  • 3
  • 51
  • 62