Search code examples
wcfweb-servicesiis

The webpage at (website) might be temporarily down or it may have moved permanently to a new web address


I have developped a wcf web service in VS2010. The web service works good in VS2010, added the web service reference to a project (winform) in the same solution, everything works great, call of methods, good.

When I deploy my web service I get :

The webpage at (website) might be temporarily down or it may have moved permanently to a new web address.

I'm new to WCF web services, what do I need to deploy to make it work correctly?

I deployed the .svc file and web.config. I deployed all .dll files in the bin directory.

I check my project folder, there is aa Web.config, Web.Release.config and Web.Debug.config.

Do I need to deploy Web.Release.config? But there is not much of a content in it :

<?xml version="1.0"?>

<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">

     <system.web>
        <compilation xdt:Transform="RemoveAttributes(debug)" />
     </system.web>

</configuration>

In my Web.config I have the appsettings, bindings, services and all, do I need to copy all the stuff in my Web.Release.config file?

Any solution/suggestion?

Thanks.


Solution

  • To host your WCF project (or anything in IIS, for that matter), it would be worth a read over Hosting in Internet Information Services. You can deploy your project by following the directions at WCF Service Publishing.

    For an example solution, lets assume you are using a machine with IIS 7. Open Internet Information Services (IIS) Manager under Administrator Tools.

    First we will choose or create an Application Pool for our application to use. It can use an existing Application Pool as long as it uses the same .NET version, or you can create a new one. You will likely have something similar to:

    IIS_AppPool

    Next, you will choose a Site to host your WCF service. You can use an existing site or create a new site. I am going to just use Default Web Site, and will Add Application...

    IIS_AddApplication

    This physical path will be where you deploy your WCF project. Say that your host machine is named MyHostMachine. To deploy your WCF, right-click your project, select Publish... In that popup, select Publish method of Web Deploy, set the Service URL (ex: http://MyHostMachine), and Site/application (ex: Default Web Site/MyWcfService).

    Note: If you have any permission issues that prevent you from doing a Web Deploy, then you can simply deploy to somewhere in the local File System, and copy the full contents from there to the application directory on your host machine.