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.

2 Answers 2

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.

1
  • Thanks Nikita. Was on my phone the other day and couldn't comment but was allowed to mark it answered. Feb 25, 2012 at 13:37
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.

1
  • 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. Feb 8, 2012 at 21:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.