WCF RIA 服务部署问题 [英] WCF RIA Service deployment issue

查看:23
本文介绍了WCF RIA 服务部署问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的示例 Silverlight 应用程序.我使用具有一个实体的实体模型向其添加了域服务.客户端应用程序只是在启动时加载实体中的所有行.当我在我的开发盒上运行它时,它按预期工作.但是,当我将它移动到我们的测试服务器时,我收到一个异常,说找不到我正在调用的方法(查询GetCTCStation"的加载操作失败.远程服务器返回错误.NotFound.).当我与 Fiddler 更密切地检查客户端/服务器通信时,我发现请求将发送到 http://[server url]/ClientBin/SilverlightApplication7-Client-Web-CTCService.svc/binary.我把域服务加到web项目的根目录下,所以不明白为什么客户端要在ClientBin目录下找.它显然不在那里.我在这里做错了什么?我从未遇到过 RIA 7 月预览版的任何问题.

I have a very simple sample silverlight application. I added a domain service to it with an entity model that has one entity. The client app simply loads all rows in the entity at startup. When I run this on my development box, it works as expected. However, when I move it to our test server I get an exception saying that the method I am calling cannot be found (Load operation failed for query 'GetCTCStation'. The remote server returned an error. NotFound.). When I inspected the client/server communication more closely with Fiddler I found out that the request is going to http://[server url]/ClientBin/SilverlightApplication7-Client-Web-CTCService.svc/binary. I added the domain service to the root of the web project, so I don't understand why the client is looking for it in the ClientBin directory. It's obviously not there. What am I doing wrong here? I have never had any issues with July preview version of RIA.

它是相对的,但会在 Generated_Code 文件中自动处理.并且 webconfig 中没有任何东西可以配置.我在创建域服务时使用了默认设置.我尝试在实例化服务时显式设置 uri,但发生了相同的异常.

It is relative, but that is handled in the Generated_Code file automatically. And there is nothing in the webconfig to configure. I used default settings when creating a domain service. I tried explicitly setting the uri when instantiating the service and same exception occurred.

推荐答案

经过长时间的挣扎并尝试了许多不同的选项后,我终于找到了解决方案.这篇文章是关键:

After a long struggle and trying out many different options I finally found the solution. This post was the key:

基本上,在发布项目时,bin 文件夹中没有包含一些 dll.确保在参考下正确设置了以下 dll(确保 System.ComponentModel.DataAnnotations 指向 C:\Program Files\Microsoft SDKs\RIA Services\v1.0\Libraries\Server\System.ComponentModel.DataAnnotations.dll):

Basically, some dll's were not inluded in the bin folder when publishing the project. Make sure under References that the following dll's are setup correctly (Make sure that System.ComponentModel.DataAnnotations is pointing to C:\Program Files\Microsoft SDKs\RIA Services\v1.0\Libraries\Server\System.ComponentModel.DataAnnotations.dll):

System.ComponentModel.DataAnnotations 和每个以 System.Web 开头的 dll 都需要将Copy Local"设置为 true.

System.ComponentModel.DataAnnotations and every dll that starts with System.Web needs to have "Copy Local" set to true.

构建项目并再次发布.这为我解决了问题.

Build the project and publish again. This fixed the problem for me.

我要感谢为解决此问题做出贡献的所有人(在此线程和其他线程中).

I would like to thank everyone that contributed to the solution of this issue (in this thread and others).

这篇关于WCF RIA 服务部署问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆