向Powershell发出在不同程序集中加载的问题

向Powershell发出在不同程序集中加载的问题,powershell,powershell-3.0,csom,sharepoint-online,Powershell,Powershell 3.0,Csom,Sharepoint Online,我一直在尝试将程序集加载到powershell for sharepoint,大多数程序集工作正常,如下所示: Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web

我一直在尝试将程序集加载到powershell for sharepoint,大多数程序集工作正常,如下所示:

Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll" 
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" 
但当我尝试添加具有不同文件路径的文件时:

Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\ClientBin\Microsoft.SharePoint.Client.Silverlight.dll"
我得到以下错误:

“添加类型:无法加载一个或多个请求的类型。有关详细信息,请检索LoaderExceptions属性。”

有人能帮忙吗

-----更新-----


定义了Microsoft.SgarePoint.Client.Folder,每个平台支持一个文件夹。鉴于powershell在桌面CLR上运行,您只需加载程序集的桌面版本:

Microsoft.SharePoint.Client.Silverlight(在Microsoft.SharePoint.Client.Silverlight.dll中)

Microsoft.SharePoint.Client.Phone(在Microsoft.SharePoint.Client.Phone.dll中)

Microsoft.SharePoint.Client(在Microsoft.SharePoint.Client.dll中)

您需要传入正确的构造函数参数:

 public Folder(
    ClientRuntimeContext context,
    ObjectPath objectPath
 )

但我认为使用以下方法更容易。

Silverlight依赖于不同版本的CLR(Silverlight版本),因为根据该版本的CLR编译的程序集无法加载到正常的CLR程序中,哪个Powershell是。那么,没有办法实现它吗?没有。您需要从Silverlight程序集中获得标准Sharepoint客户端对象模型中不可用的哪些内容?我正在尝试在代码中实现Microsoft.Sharepoint.Client.Folder,msdn网站说需要Silverlight assmebly我一直在获取错误“找不到构造函数。找不到类型为Microsoft.SharePoint.Client.Folder的合适构造函数。”您可以通过编辑您的问题来共享代码段吗?是的,我在更新中找到了
 public Folder(
    ClientRuntimeContext context,
    ObjectPath objectPath
 )