Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 767667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:03:38+00:00 2026-05-14T18:03:38+00:00

I’ve been trying to follow this tutorial for deploying a WCF sample to IIS

  • 0

I’ve been trying to follow this tutorial for deploying a WCF sample to IIS .
I can’t get it to work. This is a hosted site, but I do have IIS Manager access to the server. However, in step 2 of the tutorial, I can’t “create a new IIS application that is physically located in this application directory”. I can’t seem to find a menu item, context menu item, or what not to create a new application. I’ve been right-clicking everywhere like crazy and still can’t figure out how to create a new app. I suppose that’s probably the root issue, but I tried a few other things (described below) just in case that actually is not the issue. Here is a picture of what I see in IIS Manager, in case my words don’t do it justice:

No add Application Here http://www.freeimagehosting.net/uploads/d6edbaaf3c.png

This is “deployed” at http://test.com.cws1.my-hosting-panel.com/IISHostedCalcService/Service.svc . The error says:

    The type 'Microsoft.ServiceModel.Samples.CalculatorService', 
provided as the Service attribute value in the ServiceHost directive, 
or provided in the configuration element
 system.serviceModel/serviceHostingEnvironment/serviceActivations 
could not be found.

I also tried to create a virtual dir (IISHostedCalc) in dotnetpanel that points to IISHostedCalcService . When I navigate to http://test.com.cws1.my-hosting-panel.com/IISHostedCalc/Service.svc , then there is a different error:

This collection already contains an address with scheme http.  
There can be at most one address per scheme in this collection.

Interestingly enough, if I click on View Applications, it seems like the virtual directory is an application (see image below)… although, as per the error message above, it doesn’t work.

Is this an app or not? http://www.freeimagehosting.net/uploads/f3230be046.png

As per the tutorial, there was no compiling involved; I just dropped the files on the server as follow inside the folder IISHostedCalcService:

service.svc
Web.config
<dir: App_Code>
   Service.cs

service.svc contains:

<%@ServiceHost language=c# Debug="true" Service="Microsoft.ServiceModel.Samples.CalculatorService"%>

(I tried with quotes around the c# attribute, as this looks a little strange without quotes, but it made no difference)

Web.config contains:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <services>
      <service name="Microsoft.ServiceModel.Samples.CalculatorService">

        <!-- This endpoint is exposed at the base address provided by host:                                        http://localhost/servicemodelsamples/service.svc  -->
        <endpoint address=""
                  binding="wsHttpBinding"
                  contract="Microsoft.ServiceModel.Samples.ICalculator" />

        <!-- The mex endpoint is explosed at http://localhost/servicemodelsamples/service.svc/mex -->
        <endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange" />
      </service>
    </services>
  </system.serviceModel>
  <system.web>
    <customErrors mode="Off"/>
  </system.web>
</configuration>

Service.cs contains:

using System;
using System.ServiceModel;

namespace Microsoft.ServiceModel.Samples
{

    [ServiceContract]
    public interface ICalculator
    {
        [OperationContract]
        double Add(double n1, double n2);
        [OperationContract]
        double Subtract(double n1, double n2);
        [OperationContract]
        double Multiply(double n1, double n2);
        [OperationContract]
        double Divide(double n1, double n2);
    }


    public class CalculatorService : ICalculator
    {
        public double Add(double n1, double n2)
        {
            return n1 + n2;
        }
        public double Subtract(double n1, double n2)
        {
            return n1 - n2;
        }
        public double Multiply(double n1, double n2)
        {
            return n1 * n2;
        }
        public double Divide(double n1, double n2)
        {
            return n1 / n2;
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T18:03:39+00:00Added an answer on May 14, 2026 at 6:03 pm

    Well, it seems I got this to work. I still can’t find the “Create Application” item in IIS Manager. That part is kind of frustrating, but I’m glad it appears to be working anyway.

    I had create the physical directory IISHostedCalcService under wwwroot. That was creating some confusion; it meant that http://test.com.cws1.my-hosting-panel.com/IISHostedCalcService/Service.svc was almost working, but it shouldn’t. I moved IISHostedCalcService outside wwwroot and now the only place to access the service is http://test.com.cws1.my-hosting-panel.com/IISHostedCalc/Service.svc .

    Then, accessing http://test.com.cws1.my-hosting-panel.com/IISHostedCalc/Service.svc was throwing that “This collection already contains an address with scheme http.
    There can be at most one address per scheme in this collection.” error. It turns out the solution to that is to add the following to the web.config file, right under system.serviceModel:

    <serviceHostingEnvironment>
      <baseAddressPrefixFilters>
        <add prefix="http://test.com.cws1.my-hosting-panel.com"/>
      </baseAddressPrefixFilters>
    </serviceHostingEnvironment>
    

    After that I got a new error when ccessing http://test.com.cws1.my-hosting-panel.com/IISHostedCalc/Service.svc : “The contract name IMetadataExchange could not be found in the list of contracts implemented by the service CalculatorService”. It turns out the solution to that is to modify the web.config file as follows (i.e., add the behaviors section, and behaviorConfiguration=”SimpleServiceBehavior” in the service element):

    <configuration>
      <system.serviceModel>
        <serviceHostingEnvironment>
          <baseAddressPrefixFilters>
            <add prefix="http://test.com.cws1.my-hosting-panel.com"/>
          </baseAddressPrefixFilters>
        </serviceHostingEnvironment>
        <services>
          <service name="Microsoft.ServiceModel.Samples.CalculatorService" behaviorConfiguration="SimpleServiceBehavior">
          ...
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="SimpleServiceBehavior">
              <serviceMetadata httpGetEnabled="True" policyVersion="Policy15" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>
      <system.web>
        <customErrors mode="Off"/>
      </system.web>
    </configuration>
    

    Finally, I was able to create client proxies by pointing svcutil at http://test.com.cws1.my-hosting-panel.com/IISHostedCalc/service.svc?wsdl in step 5c of the tutorial at http://msdn.microsoft.com/en-us/library/ms733133.aspx . However, when I ran the client, I got a “The caller was not authenticated by the service” error. The solution to this was the simplest: just change binding=”wsHttpBinding” to binding=”basicHttpBinding” in the service’s web.config and the client’s web.config (or re-run svcutil after changing the service’s web.config).

    The web.config ended up looking like this:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.serviceModel>
        <serviceHostingEnvironment>
          <baseAddressPrefixFilters>
            <add prefix="http://test.com.cws1.my-hosting-panel.com"/>
          </baseAddressPrefixFilters>
        </serviceHostingEnvironment>
        <services>
          <service name="Microsoft.ServiceModel.Samples.CalculatorService" behaviorConfiguration="SimpleServiceBehavior">
    
            <!-- This endpoint is exposed at the base address provided by host:                                        http://localhost/servicemodelsamples/service.svc  -->
            <endpoint address=""
                      binding="basicHttpBinding"
                      contract="Microsoft.ServiceModel.Samples.ICalculator" />
    
            <!-- The mex endpoint is explosed at http://localhost/servicemodelsamples/service.svc/mex -->            
            <endpoint address="mex"
                      binding="mexHttpBinding"
                      contract="IMetadataExchange" />
    
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="SimpleServiceBehavior">
              <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
              <serviceMetadata httpGetEnabled="true" policyVersion="Policy15" />
              <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
              <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>
      <system.web>
        <customErrors mode="Off"/>
      </system.web>
    </configuration>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 380k
  • Answers 380k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Xpath is a query language. You use it to query… May 14, 2026 at 9:48 pm
  • Editorial Team
    Editorial Team added an answer <?php // using ldap bind $ldaprdn = 'uname'; // ldap… May 14, 2026 at 9:48 pm
  • Editorial Team
    Editorial Team added an answer got it: picBox[0] = new PictureBox(); this.Controls.Add(this.picBox[0]); May 14, 2026 at 9:48 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.