VS2010:警告从.NET项目中添加项目引用Silverlight项目 [英] VS2010: Warning on add project reference to Silverlight project from .NET project

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

问题描述

在VS2010,Silverlight 4中,.NET 4中,我有一个WCF服务和Silverlight应用程序和Silverlight正在访问类不添加服务引用,但通过共享合同。当然,这意味着我有一个Silverlight类库合同,服务有一个项目引用该库。

In VS2010, Silverlight 4, .NET 4, I've got a WCF service and a Silverlight app, and Silverlight is accessing the class not with Add Service Reference but by sharing the contract. Naturally, this means I have the contract in a Silverlight class library, and the service has a project reference to that library.

奇怪的是,这会导致A /!\在参考图标,并发出警告:

Strangely, this results in a /!\ icon on the reference, and a warning:

该项目的SilverlightClassLibrary1'不能被引用。引用的项目针对的是不同的框架家族(Silverlight的)

然而,参考工作正常(我可以使用该接口在我的Silverlight应用程序)和建立精细。

However, the reference works fine (I can use the interface in my Silverlight app) and builds fine.

这是一个错误吗?我的猜测是肯定的,因为该警告是在撒谎,也消失了,如果你添加一个程序集引用,而不是一个项目引用。我提起的错误,并有更多的信息这里为好。

Is this a bug? My guess is yes, since the warning is lying and also goes away if you add an assembly reference instead of a project reference. I filed a bug and there's more info here as well.

推荐答案

微软回应了的错误我张贴。该警告的目的是存在的,并打算予以警告,而不是错误,但我认为该文本是坏的。其原因是引用Silverlight项目将导致运行时故障的如果的不正确的计算机上安装了Silverlight。目前还没有办法来抑制警告。

Microsoft responded to the bug I posted. The warning is intended to exist and intended to be a warning and not an error, although I would argue that the text is bad. The reason is that referencing a Silverlight project will result in runtime failures if Silverlight isn't installed properly on the machine. There is currently no way to suppress the warning.

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

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