Search code examples
wcfhttpsweb-configiis-6wcf-binding

switching configurations between VS testing and deployment for WCF web service due to HTTPS


Requirement: I need to deploy a WCF webservice application in IIS 6 that is accessible with HTTPS.

Problem: It is difficult to switch between debugging in Visual Studio (which cannot use SSL in the VS 2008 ASP.Net Development Server because of the web configuration settings.

What would be the most efficient way to work around this? Can I manipulate the https configuration bindings through code so that I could simply switch between servers? Thanks!


Solution

  • If you can set different build configurations for ASP.Net Development Server and IIS you can do it with either


    For example lets say you decide Debug build to be used for dev server and Release for IIS. Using the Post build event approach create 2 web.config files with name web.config.debug and web.config.release. In the Post build event based on the mode of build rename one of the config file to web.config.
    For the first approach read the docs. I personally find web.config transformation difficult to implement.