View Full Version : Deployed WCF web services gives message "has not been pre-compiled"
mdobbles
08-29-2008, 04:22 AM
I created a WCF web service called LinkDatabaseService that I access from a Silverlight client. When it runs on localhost it works fine. The service even successfully puts and retreives data in my discountAsp.net hosted SQL Server database. When I deploy the application it doesn't work. Which at first made sense to me because the reference to the webservice in my Silverlight application was to one located at addresshttp://localhost:59546/LinkDatabaseService.svc. So I go and update the webservice reference and try to set the address to my website http://www.silverlightwebapps.com/LinkDatabaseService.svc. I can ftp to the site and see that the service is there and in the bin directory is a dll with the same name as the web project (LinkDatabaseWeb.dll). However when I try this I get the message that "the file /LinkDatabaseService.svc has not been pre-compiled, and cannot be requested".
Any suggestions? I'm using VS2008. I looked around through the options and I don't see a "pre-compile" option.
bruce
08-29-2008, 06:04 AM
Do you have a precomplied.config in the application folder (on the server)?
Bruce
DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)
mdobbles
08-29-2008, 08:22 AM
Yes. I have precompiled.config in my root (not bin) directory which is the same directory as my LinkDatabaseService.svc.
Below is the content of procompiled.config:
<precompiledApp version="2" updatable="false"/>
bruce
08-29-2008, 11:59 AM
if you have this file, you cannot just put a web service file there w/o precompiling.
Do you use VS.NET's Publish function? If so, it will precompile your site. You may want to use Copy Website.
Bruce
DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)
mdobbles
08-31-2008, 11:22 AM
I think I figured out the "has not been pre-compiled" stuff. I was publishing two websites to the same account. One was precompiled and one wasn't. I now have a new account dedicated to this project. What I'm trying to do is demonstrate a silverlight application that talks to a wcf webservice that then talks to a database.
When I run locally the silverlight client has a service reference to http://localhost:49797/DemoService.svc. DemoService has two methods that submit and get data from a database. When run locally it works fine and indeed submits data to my discountasp.net located database.
Once it's published however, it can't use localhost. So now I try to reconfigure my service reference tohttp://uiprototype.web702.discountasp.net/DemoService.svcbut when I try this I get the error message:
"This collection already contains and address with the scheme http. There can be at most one address per scheme in this collection."
You can try out the SilverlightApp at the address below (with service ref configured to localhost).
http://uiprototype.web702.discountasp.net/SilverlightClientTestPage.html
bruce
09-05-2008, 12:17 PM
see this post. http://community.discountasp.net/default.aspx?f=24&m=16709
Bruce
DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)
mdobbles
09-13-2008, 03:52 AM
I incorporated theanswers above into a step-by-step tutorial on how to build a datacentric silverlight web app that uses WCF andLINQ to submit and retreive data from a database. You can check it out at my blog at http://www.silverlightwebapps.com/Tutorials.aspx
bruce
09-16-2008, 12:00 PM
Thanks.
Bruce
DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)
vBulletin® ©Jelsoft Enterprises Ltd.