Friday, May 27, 2011

WCF: "serviceActivations could not be found"

If you received this kind of error:

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

It's trying to find Wcf1Service1.Service1. To change to your current service name, example:

public class TestService : IService1
    {
        public string GetData(int value)
        {
            return string.Format("You entered: {0}", value);
        }
    }

...from Solution Explorer, right-click Service1.svc, choose Open With..., select XML (Text) Editor, click OK, change this...

<%@ ServiceHost Language="C#" Debug="true" Service="WcfService1.Service1" CodeBehind="Service1.svc.cs" %>


...To:
<%@ ServiceHost Language="C#" Debug="true" Service="WcfService1.TestService" CodeBehind="Service1.svc.cs" %>

27 comments:

  1. mate, I searched the whole freakin internet and I cant believe you're the only one that presented this information. Thank you very much!

    ReplyDelete
    Replies
    1. I searched a lot but this is perfect .Thank you verymuch

      Delete
  2. Thanks dude, you saved me a lot of time

    ReplyDelete
  3. Nilanga ParanagamaAugust 31, 2012 at 5:19 PM

    I also searched the entire net for solution. You gave the correct solution. Thank you.
    Fianaly SVC file contains should be
    <%@ ServiceHost Language="C#" Debug="true" Service="WcfService1.Service1" CodeBehind="Service1.svc.cs" %>

    Importantly you need to clean and rebuild the solutin too

    ReplyDelete
  4. Thanks for this , you save my day !! :)

    ReplyDelete
  5. Great tip. Solved an issue with a namespace change for my service.

    ReplyDelete
  6. this was very helpful.. thx a lot dude

    ReplyDelete
  7. thanks a lot from spain , i was looking for two days

    ReplyDelete
  8. Thank you, thank you, thank you! This was extremely helpful and kept me from starting over from scratch for the fifth time!

    ReplyDelete
  9. After a lot of time on Google..Finally I got it what i was looking for...Thanx a ton for your valuable solution for my Problem

    ReplyDelete
  10. Awesome, thank you!!!!!

    ReplyDelete
  11. Thanx a lot... i searched almost about an hour luckily got ur post...thankyou

    ReplyDelete
  12. You are the man. After 2 hours, you saved me

    ReplyDelete
  13. Seriously, what would have otherwise typically amounted to hours of banging my head against a wall, this time did not because of this extremely helpful post. My gratitude

    ReplyDelete
  14. Man you saved my live! Thanks, God bless you!!

    ReplyDelete
  15. You sir are a life saver. Thanks a bunch

    ReplyDelete
  16. After 4 hours of searching... this helped. Thank you.

    ReplyDelete
  17. Hey Thanks Buddy..It woked for me..good Effort..

    ReplyDelete
  18. Thanks, you are the only who has the solution

    ReplyDelete
  19. Searched for ages before finding this simple solution - Thanks

    ReplyDelete
  20. Thanks a lot it really helpful.
    You save my day.

    ReplyDelete