如何添加外部非Windows Phone的类库项目引用到Windows Phone项目? [英] How to add external non windows phone class library project reference to a windows phone project?

查看:150
本文介绍了如何添加外部非Windows Phone的类库项目引用到Windows Phone项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我是新来在Windows Phone的开发,我想建立一个数据驱动的应用程序中,我创建了我BLL和EL和DAL,这是所有的Windows Phone类库类型的项目。 我也有类型的类库我的解决方案中,我已经添加提及MyGeneration.dOOdads.dll文件中的一个额外的项目。 现在,我希望这个项目在Windows Phone应用程序project.But被引用,当我尝试添加一个参考,VS 2010说... 无法添加选定的项目refernce.The项目引用必须有另一种银色的光芒为Windows Phone项目,是相同的或较低的版本。 。 。 。 请帮我在这种情况下。谢谢

Hi there I am new to the windows phone development and I am trying to build a data driven application in which I have Created my BLL and EL and DAL ,which are all of windows phone class library type project. I have also an extra project of type class library in my solution in which I have added the Reference to "MyGeneration.dOOdads.dll" file . Now I want this project to be referenced in the windows phone app project.But when I try to add a reference ,The VS 2010 says...."Unable to add the selected project refernce.The project reference must be another silver light for windows phone project that is the same or the lower version ". . . . Kindly help me in this scenario. Thanks

推荐答案

这不能,也无法正常工作。这款手机运行时只能访问一个timy子集完整的.NET库(当然,排序的),所以任何非手机-7库是极不可能在所有的操作。要制止这种奇怪的人,只有建立针对该运行时库允许被引用。

That can't and won't work. The phone runtime only has access to a timy subset (well, sort-of) of the full .NET libraries, so any non-phone-7 library is extremely unlikely to operate at all. To stop this surprising people, only libraries built against that runtime are allowed to be referenced.

如果可能的话,创建具有相同的C#文件的一个新项目,针对手机7框架。现在,引用这个项目。这是很可能的,一些位将无法编译(证明的事实,这也不会运行),它可以纠正的号码,如果方法(#如果块,替代的.cs 文件等)。

If possible, create a new project with the same c# files, targeting the phone 7 framework. Now reference this project. It is quite likely that some bits will fail to compile (demonstrating the fact that it also wouldn't have run), which can be rectified in a number if ways (#if blocks, alternative .cs files, etc).

您可能也有一些运气通过现有项目便携式类库 - 然而,这是最严格的子集的所有的共同框架,并且是更不可能仍编译(没有变化)。

You might also have some luck by making the existing project a "portable class library" - this, however, is the most restrictive subset of all the common frameworks, and is even less likely to still compile (without changes).

使用便携式类库项目,您可以构建不加修改工作在.NET Framework便携式组件,Silverlight的,Windows Phone 7的,或Xbox 360平台。

Using the Portable Class Library project, you can build portable assemblies that work without modification on the .NET Framework, Silverlight, Windows Phone 7, or Xbox 360 platforms.

(从 MSDN

这篇关于如何添加外部非Windows Phone的类库项目引用到Windows Phone项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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