The type provided as the Service attribute value in the ServiceHost directive could not be found

by Viper 10. March 2009 15:07

Some time when you use Add Service Reference to add reference to your WCF service, you may run into error like:

The type 'ForExService.Service1', provided as the Service attribute value in the ServiceHost directive could not be found

This error is very self explanatory telling that some type could not be found. Well if that type is missing in my service, how did the tool know about it. Well this exactly is the cause of this error. The tool looks at .svc file. And it found the following line in markup.


ServiceHost Language="C#" Debug="true" Service="ForExService.Service1" CodeBehind="CurrencyService.svc.cs

You probably can see the problem in line above. The service type is set to "ForExService.Service1" where the code behind was modified to name the service classes differently. So if you run into this kind of error, make sure that you check mark up of your service file as well to make sure that it matches the implementation in code.

Give your advice to big bosses and make money

Views: 16911

Tags:

.Net | WCF

Comments

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.5.1.7
Theme by Naveen Kohli

By Categories