Introduction

There are a couple of paths we can take towards deploying our web services.

Prerequisite – Msdeploy

Introduction

I really enjoyed realizing the benefits of Microsoft MSDeploy. It allows us to deploy to the local server and to remote hosts, as well.

Here is a list of arguments that are supported:

Argument

Meaning

/T

Simulates deployment

/Y

Actual deployment

/M

Destination Name of remote computer

/U

Destination user name

/P

Destination password

/A

Authentication – NTLM/Basic

Visual Studio Publishing

We can publish from Visual Studio and here are the steps to take:

Launch Visual Studio

Load the Project

Access the “Solution Project”

Select the project, make sure to select the Project and not the Solution

Right click on your selection

And, from the drop-down menu, select “Publish…”

Publish Web Application – Profile

The first screen upon launching “Publish Web Application” is the screen pasted below:

As we do not have existing profiles, we will access the drop-down menu and select the “New” option.

Publish Web Application – Profile

In the screen below, we have chosen the name “SoftApps”; for our Profile.

Publish Web Application – Connections

The connection method is the most important screen. It in we will choose the publish method, the service URL, and the Site/Application.

To just show how important it is, I burnt up a couple of hours, upon entering an incorrect “Site/application” in the screen below.

The right choice for “Site/application” is:

The important distinction been that the former choice has SoftAppsWCF and the corrected choice has “Default Web Site/SoftAppsWcfService“.

IIS has a default web site known as “Default Web Site”. And, you likely want to use that one. On the other hand, If you are an expert IIS Administrator, you very well might have created a new web site that you want to indicate here.

Publish Web Application – Settings

The next important screen is the “Settings” screen. In it, we choose between “debug” and “release”.

During your first iterations, I will suggest that you choose the Debug choice.

The next important decision is confirming your Database Connection Strings. Please keep in mind that if you have the “Use this connection string at runtime (update destination web.config)” checked, you may end-up over-writing previously carefully tailored DB connection profiles on targeted hosts.

Download Msdeploy

Download the latest available MSDeploy for your deployment host. As I often say, in terms of “Enterprise” Development and Deployment roadmap, Microsoft’s train is really a high speed train. Yesterday it was called MSDeploy, Today is called WebPI, and next week it will yet be called something else.

And, so I now that I need to do backups via appcmd and that they are stored in the C:\windows\system32\inetsrv\backup.

And, also importantly, I should occasionally back that folder up to an external storage.

IIS – Application Pool

Introduction

It is possible that this is not actually needed, but I think it is best to create or identify an appropriate Application Pool. And, then create and seed a Virtual Directory.

Create Application Pool

Before now I had stayed in the shadows of Microsoft .Net v2. And, so I know I need a new v4.0 Application pool:

Please keep in mind that there are only two available baseline Frameworks:

.Net Framework v4.0.30319

.Net Framework v2.0.50727

I know that Windows Communication Framework was introduced in Microsoft .Net 3.5 and so I know needed the v4.0 version.

Even the lure of an accurate blog post is not enough to lure me into digging more into the difference between the Classic and Integrated Managed Pipeline Modes. I am sure I will sooner than later run into a problem that will force me to learn.

IIS – Virtual Directory

Add a new Virtual Directory

Once you have decided on an Alias and Physical Path, please indicate as much.

Error Code: ERROR_APPPOOL_VERSION_MISMATCH
More Information: The application pool that you are trying to use has the
'managedRuntimeVersion' property set to 'v2.
This application requires 'v4.0'.
Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_APPPOOL_VERSIO
MISMATCH.

Microsoft .Net Framework / OS Compatibility

I think it is important to note that you probably should think a bit about your development goals and weigh that against current deployment state. That is, which WinOS version are you currently running and which .Net Frameworks does that OS Support.

For example, if you ‘re running MS Windows 2003, it does not support .Net Framework 4.5.

//very important as otherwise you will get the very unhelpful
//The server encountered an error processing the request.
//See server logs for more details.
//use Verbose Errors
config.UseVerboseErrors = true;

Summary:

Aforementioned, I spent a whole day trying to get this to work. I wish that I can say that using this or that tool gave me specific error messages per MS Windows 2012.

Yes, I know that I was having “Microsoft WCF Service – HTTP Activation” problem.

As I struggled a bit and Googled for help, I found out that I should pay more attention to my targeted Framework.

But, the time wasted was more with properly provisioning WCF for .Net 4.0/4.5. I assumed that the one for v3.5 will suffice; and had a blind spot to the need for checking the v4.0/v4.5 package(s), as well.