Orchard 1.6 - What is the best deployment method from Visual Studio 2012

Topics: General
Jan 19, 2013 at 12:04 PM

Hello,

I wonder what is the best method to deploy an Orchard 1.6 web site to a remote hosting server, considering that an URL rewrite (https usage) is configured to use a static IP on the remote server, and web.config should not be overwritten.

Is there a way to control and store the deployment settings for Orchard 1.6 in Visual studio 2012 ?

Coordinator
Jan 19, 2013 at 11:46 PM

I'm sorry, I don't understand what that means: "an URL rewrite (https usage) is configured to use a static IP on the remote server, and web.config should not be overwritten"

Jan 20, 2013 at 12:52 AM

When one uses SSL certificate to secure login, he needs to make a redirect from http to https, this is possible after installing the URL Rewrite tool which add values to the root web.config in order to redirect all the incoming http requests to https protocol.

for more information on this extension please look at this: http://www.iis.net/downloads/microsoft/url-rewrite

Coordinator
Jan 20, 2013 at 12:56 AM

Yes, that is true. What is your question?

Jan 20, 2013 at 1:26 AM

Considering that currently when I deploy the project to the remote server, http is reactivated.

And since I am using a WebPI version bound to an sql Express database, and since the remote server root web.config contains settings for the URL rewrite, please what is the best practice for deployment, using Visual Studio? WebMatrix ? or is there another tool which give more control on deployment settings?

Jan 20, 2013 at 1:54 AM

Is the problem that your web.config is being overwritten every time you deploy? If so, why don't you put the URL rewrite settings in your web.config locally so they are deployed? THis is what I do, though I don't use web deploy so maybe I don't know what the problem is. 

Coordinator
Jan 20, 2013 at 6:57 AM

When I deploy, I use WebDeploy, but I exclude the root web.config.

Developer
Jan 20, 2013 at 9:03 AM

When you deploy with Visual Studio, you can take advantage of web.config transformations, allowing you to maintain a local version and a server version: http://msdn.microsoft.com/en-us/library/dd465326.aspx 

But personally I would simply exclude the root web.config as Bertrand mentioned, as that's just as easy.

Jan 20, 2013 at 12:02 PM
Edited Jan 20, 2013 at 2:02 PM

@TheMonarch yes, the problem is that my web.config is being overwritten every time I deploy and if I put the URL rewrite settings in my web.config locally I cannot any more load my site on localhost. I was looking for a way to exclude web.config from deployment as said @bertrandleroy, and I think that the solution is in the very interesting link provided by @sfmskywalker that I need now to explore.

On top of that, I think best practice to have better control, is to use Orchard source version instead of WebPI version.

Am I right ?

Jan 20, 2013 at 1:59 PM
Edited Jan 20, 2013 at 2:01 PM

Visual Studio doesn't give the ability to open the publish wizard when it detects a WebPI version

Now I have downloaded and installed a new Orchard 1.6 source version, it builds without any error in Visual studio 2012, but when I want to publish using the Publish wizard and the Web deploy method, after configuring the right profile, at the last step, falled in the next error: 

Could not open Source file: Could not find a part of the path 'C:\Orchard 1.6\src\Orchard.Web\Media\web.config;Media\web.config'. 0 0 Orchard.Web 

Any thoughts please ?

 

Coordinator
Jan 20, 2013 at 9:47 PM

Is the file there?

Coordinator
Jan 20, 2013 at 10:35 PM

Apparently you can exclude it from your deployment.

Jan 21, 2013 at 11:13 AM

I verified that "C:\Orchard 1.6\src\Orchard.Web\Media\web.config" is there and I can open it,

also from the Publish wizard I have the ability to exclude "C:\Orchard 1.6\src\Orchard.Web\web.config" by unchecking the box beside the file name.

Unchecking or checking mark this last one doesn't remove the error.

Coordinator
Feb 10, 2013 at 10:55 PM