Visual studio 未能加载接收器程序集-FileNotFoundException

Visual studio 未能加载接收器程序集-FileNotFoundException,visual-studio,sharepoint,global-assembly-cache,Visual Studio,Sharepoint,Global Assembly Cache,与此抗争的是,当我的功能中没有EventReceivers时,项目会构建和部署,而当我在功能中没有EventReceivers时,项目就会失败。我不完全确定FileNotFoundException引用的是哪个文件 visual studio中给定的错误 Error 1 Error occurred in deployment step 'Activate Features': Failed to load receiver assembly "Decisions.Features, V

与此抗争的是,当我的功能中没有EventReceivers时,项目会构建和部署,而当我在功能中没有EventReceivers时,项目就会失败。我不完全确定FileNotFoundException引用的是哪个文件

visual studio中给定的错误

Error   1   Error occurred in deployment step 'Activate Features': Failed to load receiver assembly "Decisions.Features, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8d09acb153961cfd" for feature "Decisions.Features_DeployDecisionCommittee" (ID: 779492d8-f053-45ce-8340-5fa6d7f87a90).: System.IO.FileNotFoundException: Could not load file or assembly 'Decisions.Features, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8d09acb153961cfd' or one of its dependencies. The system cannot find thefile specified.
File name: 'Decisions.Features, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8d09acb153961cfd'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

=== Pre-bind state information ===
LOG: DisplayName = Decisions.Features, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8d09acb153961cfd
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/
LOG: Initial PrivatePath = C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\SharePoint\VstspCache7880
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\SharePoint\vssphost5.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Decisions.Features, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8d09acb153961cfd
LOG: The same bind was seen before, and was failed with hr = 0x80070002.

    0   0   Decisions.Features
程序集绑定日志查看器

*装配活页夹日志条目(25/04/2014@11:11:41)*

操作失败。 绑定结果:hr=0x80070002。系统找不到指定的文件

从以下位置加载的程序集管理器:C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll 在可执行文件C:\Program Files(x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\SharePoint\vssphost5.exe下运行 ---下面是详细的错误日志

==预绑定状态信息=== 日志:DisplayName=Decisions.Features,版本=1.0.0,区域性=neutral,PublicKeyToken=8d09acb153961cfd (详细说明) 日志:Appbase=file:///C:/Program 文件(x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/ 日志:Initial PrivatePath=C:\Program Files(x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\SharePoint\VstspCache7880 日志:Dynamic Base=NULL 日志:缓存基=NULL 日志:AppName=vssphost5.exe

正在调用程序集:(未知)。 日志:此绑定在默认加载上下文中启动。 日志:使用应用程序配置文件:C:\Program Files(x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\SharePoint\vssphost5.exe.Config 日志:使用主机配置文件: 日志:使用C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config中的计算机配置文件。 日志:发布策略参考:Decisions.Features,版本=1.0.0,区域性=neutral,PublicKeyToken=8d09acb153961cfd 日志:GAC查找失败。 日志:正在尝试下载新URLfile:///C:/Program 文件(x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/Decisions.Features.DLL。 日志:正在尝试下载新URLfile:///C:/Program 文件(x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/Decisions.Features/Decisions.Features.DLL。 日志:正在尝试下载新URLfile:///C:/Program 文件(x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/VstspCache7880/Decisions.Features.DLL。 日志:正在尝试下载新URLfile:///C:/Program 文件(x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/VstspCache7880/Decisions.Features/Decisions.Features.DLL。 日志:正在尝试下载新URLfile:///C:/Program 文件(x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/PublicAssemblys/Decisions.Features.DLL。 日志:正在尝试下载新URLfile:///C:/Program 文件(x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/PublicAssemblys/Decisions.Features/Decisions.Features.DLL。 日志:正在尝试下载新URLfile:///C:/Program 文件(x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/Decisions.Features.EXE。 日志:正在尝试下载新URLfile:///C:/Program 文件(x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/Decisions.Features/Decisions.Features.EXE。 日志:正在尝试下载新URLfile:///C:/Program 文件(x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/VstspCache7880/Decisions.Features.EXE。 日志:正在尝试下载新URLfile:///C:/Program 文件(x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/VstspCache7880/Decisions.Features/Decisions.Features.EXE。 日志:正在尝试下载新URLfile:///C:/Program 文件(x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/PublicAssemblys/Decisions.Features.EXE。 日志:正在尝试下载新URLfile:///C:/Program 文件(x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/PublicAssemblys/Decisions.Features/Decisions.Features.EXE。 日志:所有探测URL都已尝试但失败


“帮助”

这对我很有用

First resolution:
·          Retract the Solution/WSP in VS.
·          Close VS.
·          Reopen VS and deploy the Project.

Second resolution:
If closing VS after retraction doesn't solve the problem then a larger workaround is:
·          Redeploy the project -> This will show an error during feature activation.
·          Go to SharePoint UI and Activate and then Deactivate the deployed feature that was showing activation error in VS.
·          Retract the Solution/WSP in VS.
·          Close VS.
·          Reopen VS and deploy the Project.

这对我很有效:在程序集信息中更改VS项目的版本。例如,我将程序集和文件版本更改为1.1.0.0,而不是1.0.0.0

已部署,没有问题


之后,我可以将其设置回1.0.0.0,并继续部署,不会出现错误或问题…

这对我很有效。


在项目上单击鼠标右键,然后选择“属性”。在“属性”菜单中,选择“签名”。在“签名”选项卡的“选择强名称密钥文件”下,选择“新建”并键入密钥名称。然后选择不需要密码。完成所有操作后,重新生成文件并开始部署

另一个帮助我的解决方案: 转到要部署到的站点,并从UI激活功能。
从Visual Studio重新部署。

Decisions.Features.DLL是您要包含在包中的程序集吗?检查生成的.WSP并查看程序集是否实际在内部(您可以使用7-zip在维护结构的同时轻松解包WSP)。嗨,科林,您找到任何修复方法了吗?
First resolution:
·          Retract the Solution/WSP in VS.
·          Close VS.
·          Reopen VS and deploy the Project.

Second resolution:
If closing VS after retraction doesn't solve the problem then a larger workaround is:
·          Redeploy the project -> This will show an error during feature activation.
·          Go to SharePoint UI and Activate and then Deactivate the deployed feature that was showing activation error in VS.
·          Retract the Solution/WSP in VS.
·          Close VS.
·          Reopen VS and deploy the Project.