Skip to main content
Home Forums General Silverlight Hosting and Streaming Sorry, another WCF hosting problem!
4 replies. Latest Post by moonlit_valley on July 5, 2009.
(0)
moonlit_...
Member
1 points
13 Posts
07-05-2009 7:38 AM |
Sorry in advance, I know this question has been asked a plenty, but my brain is fried trying to figure this how this should be put together. I've tried so many suggestions in the forums and articles, but to no avail.
I'm getting the parse error: The CLR Type 'ClimateRisk.Web.SuburbService.SuburbServiceFactory' could not be loaded during service compilation.
<%@ ServiceHost Language="VB" Debug="true" Service="ClimateRisk.Web.SuburbService" CodeBehind="SuburbService.svc.vb" Factory="ClimateRisk.Web.SuburbService.SuburbServiceFactory" %>
I have create a solution called climateRisk, and a SL enabled WCF service that resides in the root of the climateRisk.Web project (not in a App_Code folder). The service is called SuburbService.svc. The solution works fine when served from within Visual Studio using it's internal webserver. Before publishing the solution, I put the following Factory code in SuburbService.svc.vb under the class the holds the OperationContract.
Public
Inherits
Return
Protected
Dim
MyBase
End
Is this the right place to put this code?
When I publish it, I notice that the SuburbService.svc.vb file is no where to be seen. Nor is there a App_Code.dll. Is this the problem? Or is the code placed in the solution dll, CLimateRisk.dll file? I tried manually placing the SuburbService.svc.vb file in the root directory on the hosting site (as it is on my local machine), but this did not work.
Some posts and articles are saying that a new website should be created with a new WCF service and this should be published seperately? I tried this, and Service.vb and IService.vb are produced. How do these relate to my original SuburbService code? Do I copy code from one service to another? It seems odd, that I need to do this big extra step, when it appears to work as it is from with Visual Studio.
I have also tried all of the following in the Markup, as so many posts have different offerings:
Factory="SuburbServiceFactory
Factory="SuburbService.SuburbServiceFactory
Factory="ClimateRisk.Web.SuburbService.SuburbServiceFactory
Any help would be greatly appreciated.
Drew
ken tucker
All-Star
16324 points
2,493 Posts
07-05-2009 8:35 AM |
If you publish a web site it will precompile all the code in the app_code folder and put it in a file named precompiled.web. You would not see a file named app_code.dll. You should not copy the vb file to the spot your hosting your website if you publish it.
07-05-2009 10:16 AM |
And there's no need to create a seperate Web Service Project (as described here http://blogs.msdn.com/nikola/archive/2008/03/12/visual-studio-2008-walkthrough-creating-hosting-and-using-wcf-services-with-silverlight-2-beta-1.aspx), if it's already working locally?
07-05-2009 11:11 AM |
When I create a silverlight project I have it create the web application at the same time. I put my services in there.
07-05-2009 6:27 PM |
ken tucker: When I create a silverlight project I have it create the web application at the same time. I put my services in there.
Thanks, I've stuck with that, and this has taken me to a new message:
InitializeRuntime requires that the Description property be initialized. Either provide a valid ServiceDescription in the CreateDescription method or override the InitializeRuntime method to provide an alternative implementation.
Can anyone one clarify what this means?
Thank you