WCF service hosting trouble

Discussion in 'ASP.NET WebServices' started by strato, Mar 23, 2009.

  1. Hi,

    I created a simple WCF service with VS2008. I can host it both in VS2008 and in IIS7 on my PC. But when I deploy it to DASP I get this error:

    Below is the error I get:
    The type 'AddressServiceLibrary.AddressService', provided as the Service attribute value in the ServiceHost directive could not be found.

    Can someone give me some troubleshooting pointers? Thanks. My directory structure is like this:

    WCF1
    - AddressServiceSite
    - APP_CODE - nothing here
    - APP_DATA - nothing here
    - bin
    - AddressServiceLibrary.dll
    - Address.svc
    - web.config

    I browse it like this: http://<domain name>/wcf1/AddressServiceSite/address.svc
     
  2. Not sure from what you wrote, but shouldnt the dll be in the bin folder?
     
  3. Actually, that's where it is. My post was reformatted my the forum software, I guess. I hope the below is clearer.

    WCF1
    - AddressServiceSite
    -- APP_CODE - nothing here
    -- APP_DATA - nothing here
    -- bin
    --- AddressServiceLibrary.dll
    -- Address.svc
    -- web.config
     
  4. I found the solution. Apparrently, ASP.NET requires the web.config to be in the root directly. So when I moved it there, the error disappeared. However, another error appeared:

    "This collection already contains an address with scheme http"

    This one I solved by adding this code in the system.servicemodel section of my web.config (I found this tip in http://blog.befruit.com/2008/09/wcf-error-this-collection-already.html)

    <serviceHostingEnvironment>
    <baseAddressPrefixFilters>
    <add prefix="http://www.example.com"/>
    </baseAddressPrefixFilters>
    </serviceHostingEnvironment>

    So now I'm a happy camper.
     
  5. Before you moved the web.config file to your root, did you setup the folder your application is in as an application folder? You can do this by logging into yourcontrol panel and under Web Application Tool should have setup the folder as an application folder.
     
  6. Raymond, I guess I could have done that too. Thanks.
     

Share This Page