从其他非Silverlight项目中添加对Silverlight项目的引用 [英] add reference to Silverlight project from other non silverlight project

查看:70
本文介绍了从其他非Silverlight项目中添加对Silverlight项目的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有使用NHibernate作为ORM的Silverlight应用程序.我有用于数据(mapp和实体),数据访问和Silverlight的项目.我想在SL项目中添加对数据访问以执行方法的引用,但是SL只能从其他SL项目中获取引用.

I have Silverlight application using NHibernate as a ORM. I have projects for Data(mapp and entities), data access and Silverlight. I want to add to SL project reference to data access to execute methods, but SL can only get reference from other SL project.

我如何省略它?如果我在WCF上托管数据访问项目,我可以将WCF引用到SL吗?

How can I omit it? If I host data access project on WCF I could reference WCF to SL?

请帮助! :)

推荐答案

是的,您可以将数据访问程序集公开为一堆WCF服务,然后从SL应用程序中调用它们.

Yes, you can expose your data access assembly as a bunch of WCF services and then call them from the SL application.

还有另一种方法-创建Silverlight类库,然后向其中添加新的链接文件-这些链接文件是数据访问程序集中的类文件.

There is also another way - make a Silverlight class library, and then add new linked files to it - those linked files being the class files from your data access assembly.

这是先前的答案解释了链接,尽管您应该注意,由于您的数据访问类现在将使用Silverlight运行时,因此您可能无权访问所需的所有System命名空间(尽管您可以选择要选择的文件)到新项目中,并重构因此而无效的项目.

Here is a previous answer that explains the linking, although you should note that because your data access classes will now being using the Silverlight runtime you may not have access to all the System namespaces that you want (although you can pick and choose what files you want to add to the new project, and refactor the ones that don't work because of this).

这篇关于从其他非Silverlight项目中添加对Silverlight项目的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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