2009-12-24 76 views
0

在我的Visual Studio解决方案中,我有3个项目。
- Common(Root namespace:PodcastPlayer.Common)
-PodcastPlayer(Root namespace:PodcastPlayer)这是Silverlight项目。
-PodcastPlayer.Web(根名称空间:PodcastPlayer.Web)
VB.NET - 从解决方案中的其他项目导入命名空间

通常,我有几个类和服务引用。 但我的问题是,我不能在PodcastPlayer项目中使用PodcastPlayer.Common命名空间。
如何解决这个问题?

当我尝试在PodcastPlayer我得到这个消息添加项目引用:

alt text
http://bildr.no/view/553295

+0

你能如何,你不能在播放器项目中使用常见的详细点吗? (我假设你已经添加了对它的引用) – 2009-12-25 10:35:48

+0

当我在PodcastPlayer项目中放入“Imports PodcastPlayer.Common”时。我收到命令空间不存在的消息。 – sv88erik 2009-12-25 13:35:21

回答

1

你的错误消息说,它很清楚。您的公共库不是Silverlight项目。 Silverlight实现了CLR的一个子集,所以你不能包含常规的.Net库(另一种方式是允许的)。

如果您有Common的源文件,您可以将项目类型更改为Silverlight库并重新编译(或将源文件复制到Silverlight库项目中)。

您可能会遇到一些错误,因为Silverlight不包含.Net运行时的所有功能,因为它是一个子集。

有关的主题文章:

http://bytes.com/topic/c-sharp/answers/716163-adding-c-library-reference-silverlight-project Sharing C# code between Windows and Silverlight class libraries

相关问题