Fix: WCF - The type provided as the Service attribute value in the ServiceHost directive could not be found
I wanted to expose some raw data to users in my current ASP.NET 3.5 web site project. I created a subdirectory called ‘datafeeds’ and added a WCF Data Service. I wired the dataservice up to the Entity Framework class and, on running the ItemDataService.svc file, was greeted with:
The type <> provided as the Service attribute value in the ServiceHost directive could not be found
So why couldn’t it find the class? It was right there in the… oops!
Instead of putting the ItemDataService.vb codebehind file in the App_Code folder, VS 2010 had created a new App_Code folder under the datafeeds folder.
The fix was to drag ItemDataService.vb from the incorrect App_Code folder and drop it into the higher App_Code folder where the ASP.NET compiler knows to look for such files.
Sheesh! Why do I lose time with these silly things?
Ken