WCF Service Deployment in IIS Page cannot be displ

2019-01-29 05:28发布

Arghhh! I'm getting so frustrated trying to get my head around this WCF service.

So I created a WCF service. It works fine in my laptop where I launch it from Visual Studio 2010. Now I have to deploy it on a Windows Server 2003 machine. So I created a virtual directory on that server's IIS. Next I copied the WCF Service DLL file in the virtual directory. I also created an SVC file which had the following entry:

<%@ ServiceHost Language="C#" Service="AMWCF.Service1" %>

Ok first of all, I'm so confused here. Where does this line tell the Server where the DLL file is? It just says "AMWCF.Service"! not file location!

So when I try to launch my webpage, it gives an error "THE PAGE CANNOT BE DISPLAYED". I've tried everything which I can find on the net including:

  1. Reinstalling the ServiceModelReg
  2. Restrarting IIS
  3. Allowing ASP.NET in IIS

Sorry for showing my frustration here. I really really reallllly appreciate any help. Thanks guys. You guys are the best

3条回答
不美不萌又怎样
2楼-- · 2019-01-29 05:47

Page cannot be displayed error is coming from IIS.

  • Add a simple html file and see if IIS can serve that file
  • Add a simple aspx file and see if IIS can serve that file
  • Now add .svc file as one of the documents in document list in IIS
  • Place dll in a bin folder under the virtual directory's physical path
  • Once you get the asp.net run time errors, it is easy find the answers for them
查看更多
Bombasti
3楼-- · 2019-01-29 05:48

If you have a class library with your WCF service inside, you need to copy the service DLL into the .\bin folder one level down from your virtual directory. That's where the WCF runtime looks for its service classes.

Also see these resources:

The WCF Developer Center on MSDN has a "Beginnger's Guide" (available right from the landing page) which has tons of those excellent 5-10 minute screencasts explaining all things WCF to you - highly recommended!

查看更多
放荡不羁爱自由
4楼-- · 2019-01-29 06:01

If this stuff is new to you, you should use the visual studio deployment features, try right click your web project and click deploy, I think it'll solve your issues, you can even deploy using ftp through this wizard.

查看更多
登录 后发表回答