添加在Silverlight refrence问题 [英] Add refrence problem in silverlight

查看:165
本文介绍了添加在Silverlight refrence问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Silverlight应用程序,它有它一个类库项目。日类库运行.NET Framework中4和Silverlight项目是在Silverlight 3运行时,我想补充的silverlight的凸出的类库引用我得到这个消息:

I have a silverlight application which has a class library project in it. th class library is running in .Net framework 4 and the silverlight project is running in silverlight 3. when I want to add a reference in the silverlight proj to the class library I get this message:

"You can't add a reference to Classlibrary1.dll as it was not built against the silverlight runtime. silverlight project will only work with silverlight asseblies."

我试着改变ClassLibrary1的用于.NET Framework 3.5的,3和2的框架,但它并不能帮助。 (和我的Silverlight应用程序只能在Silverlight 3中运行)

I've tried to change the framework the classlibrary1 used to .net framework 3.5, 3, and 2 but it does not help. ( and my silverlight application can only run in silverlight 3)

任何suggetions?

Any suggetions?

谢谢!

推荐答案

显然 Silverlight项目将只使用Silverlight asseblies 工作。 的CLR的.NET和Silverlight是不同的,因此,组件不兼容。这些框架提供了不同的组类,组件有不同的版本,等等。

Apparently Silverlight project will only work with Silverlight asseblies. CLRs for .NET and Silverlight are different, therefore assemblies are not compatible. These frameworks provide different set of classes, assemblies have different versions, et cetera.

您需要更改您的类库 Silverlight的类库
通过不断变化的项目文件中手动或者通过创建的Silverlight类库项目,然后复制它的来源。如果您需要在同一库非Silverlight项目,不希望维护两个版本,可以考虑使用添加为链接添加现有项功能... 对话框只引用原始来源,而不将它们复制。但是,你需要确保你只使用可在这两个平台的功能这两个版本的库来构建。

You need to change your Class Library to Silverlight Class Library.
This can either be done by changing project file manually or by creating Silverlight Class Library project and copying the sources in it. If you need the same library for a non-Silverlight project and don't want to maintain two versions, consider using Add as Link feature of Add Existing Item... dialog to only reference the original sources without copying them. But you'll need to make sure you only use functionality available on both platforms for both library versions to build.

这篇关于添加在Silverlight refrence问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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