kowsheek
kowsheek

Reputation: 552

Web Publish to Azure website doesn't build in the correct configuration for an ASP.Net 5 application

When trying to publish to an Azure website using Web Publish in VS CTP6 the output pushed to the website is always built in Debug and never picks up the specified configuration (eg Release).

If the publish is made to the file-system, and I run web, the specified configuration seems to be respected.

Steps

  1. In a new project or in an existing ASP.Net 5 project do something to the effect of:

    #if RELEASE

    ViewBag.Message = "Your application description page in Release " + DateTime.Now;
    

    #else

     ViewBag.Message = "Your application description page in Debug " + DateTime.Now;
    

    #endif

  2. Go through the flow for creating a publish profile to an Azure website in Web Publish

  3. In the Settings step select Release as the configuration and select Precompile during publish (this is what I would like to do ideally, but the issue can be reproduced without this option)
  4. Publish and check the result of Step 1

Expected

The output of Step 1 above should be the one with in the RELEASE clause.

Actual

The DEBUG clause's content is always being output.

(I can share files from the source or deploy output, as needed.)

Upvotes: 0

Views: 134

Answers (1)

Glenn
Glenn

Reputation: 1167

There is a problem when trying to deploy with --no-source to a server that already has source code deployed to it.

Until that is fixed, if there is source on the server already then you should try to:

  1. Delete %temp%\AspNetPublish folder
  2. Delete approot and wwwroot folder on the server.
  3. Publish with no-source option.

Upvotes: 2

Related Questions