Silverlight 3模块化& WCF参考问题 [英] Silverlight 3 Modular & WCF reference issues

查看:91
本文介绍了Silverlight 3模块化& WCF参考问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了学习Silverlight,我正忙于Silverlight 3项目.我正在从以下示例中进行工作:
构建模块化Silverlight应用程序 [

I''m busy with a Silverlight 3 project for the purpose of learning Silverlight. I''m working from this example:
Building Modular Silverlight Applications[^]

I''ve got it all to work just fine, but I''m finding it a bit difficult to get my WCF service so it would work properly across all modules and Silverlight and WCF are both pretty new to me. So now I''m somewhat stuck. To have access to my service through all my modules I have to add a reference to the service in each module. This seems redundant to me.

So my Question here is: Is there a way to have a single reference to the service and then have all the modules work from that single reference?? Something like a wrapper class maybe or interface?? I just don''t know how to implement something like this with silverlight and WCF.


I hope my question makes sens.
Thanks

推荐答案

我按照我想要的方式进行了工作... sorta.我在解决方案中创建了另一个项目,并向其添加了Service引用.然后,我仅在所有模块中引用新项目.因此,我可以访问所有模块中服务中的所有内容.但是该应用仍然无法运行.现在,我仍然必须在每个模块.xap中包含"ServiceReferences.ClientConfig"文件,以便该模块可以实际调用该服务.

我会继续寻找其他方法,但是现在可以.
I got it to work they way I wanted... sorta. I created another project in my solution and added the Service reference to it. Then I just reference the new project in all the modules. So I have access to everything in the service in all my modules. But the app would still not run. I now still have to have the "ServiceReferences.ClientConfig" file included in each module .xap so the module can actually call the service.

I''ll keep looking for other ways though, but for now this will do.


确保所有跨域/客户端访问策略文件都已就绪.
Make sure all your cross domain / client access policy files are in place.


这篇关于Silverlight 3模块化& WCF参考问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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