简体   繁体   English

为什么WCF Rest服务(未使用WCF Rest服务模板创建)无法正常工作?

[英]Why is the WCF rest service (not created with WCF Rest service template) not working?

I created a WCF Rest service but not with the WCF Rest Service template. 我创建了WCF Rest服务,但没有创建WCF Rest服务模板。 I just used a simple class library project and then made all the settings which were listed to create a WCF Rest service. 我只使用了一个简单的类库项目,然后进行了列出来创建WCF Rest服务的所有设置。

It compiled fine and I deployed it on IIS 7. When I ran the service it gave me the following error: 它编译良好,并在IIS 7上部署了它。当我运行该服务时,出现以下错误:

The server encountered an error processing the request. Please see the service help page for constructing valid requests to the service.

I then downloaded the WCF Rest template and created a sample service. 然后,我下载了WCF Rest模板并创建了示例服务。 Again deployed it on IIS7 and this is working fine. 再次将其部署在IIS7上,一切正常。 I compared the project, solution, references, web.config and other files as well and see no difference. 我还比较了项目,解决方案,参考,web.config和其他文件,没有发现任何区别。 Yet the WCF Rest Template service is working and the other once is not working... 但是WCF Rest Template服务正在运行,而其他一次则无法运行...

Any thoughts? 有什么想法吗?

Regards, Sid 问候,席德

I was able to solve it. 我能够解决。 The problem was that in the service there was an activator, trying to create an object. 问题是在服务中有一个激活器,试图创建一个对象。 This object creation was failing at runtime. 该对象创建在运行时失败。 So, even though code was compiling the service was not able to get started. 因此,即使代码正在编译,该服务也无法启动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM