我如何在Silverlight应用程序中使用非Silverlight的组件?应用程序、组件、如何在、Silverlight

2023-09-02 01:58:38 作者:笑着流泪、我学不会

我工作的项目(纯爱好,增锐我的技能),其中有一个统一的后端和多个前端(ASP.NET MVC 1.0 / jQuery和Silverlight 2中)。当我尝试添加引用到我的业务层组件在Silverlight 2项目(VS2008);它被拒绝,因为它不是一个Silverlight程序集。

I'm working an project (pure hobby, "Sharping my skills") which has one unified back-end and multiple front-ends (ASP.NET MVC 1.0/JQuery and Silverlight 2). When I try to add reference to my business layer assembly in the Silverlight 2 project (VS2008); It gets rejected, because it's not a Silverlight assembly.

时的一种方法,包括和引用不Silverlight的程序集在Silverlight应用程序?

Is their a way to include and reference a non-Silverlight assembly in a Silverlight app?

推荐答案

没有没有。 Silverlight的运行在一个完全不同的CLR这与正常(桌面)CLR不相容。它有一个基本不同的BCL中,最重要的是不同的元数据版本号的API。这两个因素,除其他外,prevent组件编制从默认的Silverlight的CLR运行的桌面CLR。

No there is not. Silverlight runs on a completely different CLR which is incompatible with the normal (desktop) CLR. It has an underlying different set of APIs in the BCL and most importantly a different metadata version number. These two factors, among others, prevent assemblies compiled for the desktop CLR from running by default on the Silverlight CLR.

所有的组件必须Silverlight的具体编制。

All assemblies must be compiled specifically for silverlight.