sharepoint - 激活wsp文件时出现Failed to load receiver assembly异常

标签 sharepoint sharepoint-2010 sandbox sharepoint-2013 wsp

我有一个沙盒解决方案,它是从 VS2010 创建的。沙盒实际上是为 SharePoint 2010 创建的。沙盒解决方案在 Office 365 (即 SharePoint 2013 Online)中也能顺利运行。激活后,它将添加一个库并在该库中添加一个 Web 部件页面。但是,当我尝试在 SharePoint 2013 Server(本地版本,安装在我们的服务器本地)中激活相同的沙盒解决方案时,我收到了从 FUSLOGVW 看到的以下错误。

*** Assembly Binder Log Entry  (6/16/2013 @ 2:55:20 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable  C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\usercode\SPUCWorkerProcess.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = ELV1\spadmin
LOG: DisplayName = SolTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fd92f09fdeeefafe
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/15/usercode/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = Sandboxed Code Execution Partially Trusted AppDomain
Calling assembly : Microsoft.SharePoint, Version=15.900.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c.


LOG: This bind starts in default load context.

LOG: Using application configuration file: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\usercode\SPUCWorkerProcess.exe.Config

LOG: Using host configuration file: 

LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.

WRN: Application configuration file safe mode disallowed.

LOG: Post-policy reference: SolTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fd92f09fdeeefafe
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/15/usercode/SolTest.DLL.

LOG: Attempting download of new URL file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/15/usercode/SolTest/SolTest.DLL.

LOG: Attempting download of new URL file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/15/usercode/assemblies/SolTest.DLL.

LOG: Attempting download of new URL file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/15/usercode/assemblies/SolTest/SolTest.DLL.

LOG: Attempting download of new URL file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/15/usercode/SolTest.EXE.

LOG: Attempting download of new URL file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/15/usercode/SolTest/SolTest.EXE.

LOG: Attempting download of new URL file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/15/usercode/assemblies/SolTest.EXE.

LOG: Attempting download of new URL file:///C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/15/usercode/assemblies/SolTest/SolTest.EXE.

LOG: All probing URLs attempted and failed.
..

并且 ULS 日志显示以下异常

>UserAgent not available, file operations may not be optimized.    at .....dd(Int32 >solutionGalleryItemId)     at Microsoft.SharePoint.WebControls.SolutionItemButton.ActivateItem()     ...
>Solution Deployment : Looking for 'ReceiverAssembly' attribute in manifest root node for solution >'Company Office 365 Sandbox Package.wsp'.    
>Solution Deployment : Looking for 'ReceiverClass' attribute in manifest root node for solution 'Company Office 365 Sandbox Package.wsp'     
Solution Deployment  Missing one or more of the following attributes from the root node in solution Company Office 365 Sandbox Package.wsp: assembly , type.     

功能安装: 将功能“SolTest_Company Office 365 沙盒功能”(ID:“44613a8d-0406-4dea-ac63-09db6aba469a”)安装到场中。

无法为功能“SolTest_Company Office 365 沙盒功能”(ID: 44613a8d-0406-4dea- ac63-09db6aba469a).: System.IO.FileNotFoundException: 无法加载文件。

............
............

所以我想知道为什么沙盒解决方案适用于 SharePoint 2013 的云版本,但不适用于本地版本。有人可以阐明一下吗?我尝试使用浏览器激活沙盒解决方案。我没有尝试使用电源外壳。会有什么不同吗?

Thanks,
Prakash

最佳答案

我也是这种情况;通过 Nappa 开发的应用程序,部署并在 sharePoint Online(与 Office 365 帐户捆绑在一起)上运行。

当我想在我们的 SP 2013 本地服务器(通过 PowerShell)上安装它时,它会在“正在安装”状态期间退出,并且在日志中我得到了著名的:“缺少以下一个或多个属性来自解决方案 SOLUTION_NAME.wsp 中的根节点:程序集“”,类型“”。"

这个错误的含义很广,因为它可能来自 SP 版本之间的差异、使用的变量类型、错误的 list 文件、WebConfiguration ...

就我而言,我还没有找到它的来源。我的应用程序非常简单,它只加载一个列表内容,并使用纯 web (HTML/JS/CSS) 以特定方式显示它,所以我认为它不会来自奇怪的依赖......

关于sharepoint - 激活wsp文件时出现Failed to load receiver assembly异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17160490/

相关文章:

应用程序购买收据验证中的 iOS - 沙盒与生产网址?

c# - 静态变量在负载平衡环境中不起作用。

Sharepoint 2010 在文档库中创建 PDF 文档

javascript - 是否可以使用 REST API 将项目添加到 Sharepoint 2010 中的站点级别列表?

SharePoint 应用 : Deploy custom action to entire site collection

.net - 现在是将基于.net的大型分布式SOA系统转换为.net Core的合适时机吗?

java - Rhino:限制可以从 JavaScript 访问的 Java 包

javascript - 使用 html5 FileReader 访问本地文件

SharePoint 中的 JavaScript REST GET 变量范围困惑

javascript - 一个函数在作用域内,一个函数在作用域外,即使这两个函数定义在同一位置