views:

24

answers:

1

Hi,

I want to use new .Net framework 4.0 feature "Configuration-Based Activation".

I wrote that lines into web.config.

<system.serviceModel>
     <serviceHostingEnvironment>
        <serviceActivations>
           <add factory="MyCompany.Core.Hosting.WcfHostFactory" relativeAddress="Greeting.svc" service="MyCompany.Core.Services.GreetingService, MyCompany.Core.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=1ccaa18r85yu07a4"/> 
        </serviceActivations>
     </serviceHostingEnvironment>
</system.serviceModel>

But when I try to browse http://localhost/MyCompany.Core/Greeting.svc, the browser says "The resource cannot be found. HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly."

How can I solve that problem?

Thanks for your help.

+1  A: 

Hello,

check that your site is configured correctly and that URL points to correct resource. HTTP 404 is not related to activation configuration. If there could be any problem with activation you should get HTTP 500.

Did you define any endpoints for your service? If so check that http endpoint is also defined. If you didn't define any endpoints check that site has http binding configured.

Best regards, Ladislav

Ladislav Mrnka
I found my mistake. Relative address must be relative to the root of virtual application. I corrected the address and everythings Ok.
mkus