gpt4 book ai didi

deployment - 为什么在调试时包中缺少项目的程序集?

转载 作者:行者123 更新时间:2023-12-04 04:45:54 35 4
gpt4 key购买 nike

我已经调试了一段时间没有问题的SharePoint项目。

今天,我在项目的唯一功能中添加了功能接收器。我还没有更改有关Visual Studio默认添加的空接收器类的任何内容。

“Package”命令现在生成一个包含我项目的DLL文件的软件包(如您所愿-添加功能接收器不应对此进行任何更改)。

但是,当我调试时,生成的程序包不包括我项目的DLL文件,并且部署工作因以下错误而失败:

Error occurred in deployment step 'Add Solution': Failed to load receiver assembly "ABC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2377fad544a7c307" for feature "ABC_XYZ Feature" (ID: dca34989-a2f2-413b-b5c4-958e0bbb84ef).: System.IO.FileNotFoundException: Could not load file or assembly 'ABC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2377fad544a7c307' or one of its dependencies. The system cannot find the file specified. File name: 'ABC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2377fad544a7c307' at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



删除功能接收器后,我可以再次进行调试而没有任何问题,但是,只要我重新添加功能接收器,问题就会再次出现。

我已经尝试了清理和重建,然后进行调试,但是除非/直到我删除功能接收器,否则错误不会消失。

为什么当我使用“Package”命令时项目的程序集会包含在包中,而当我使用“Start Debugging”命令时却没有,并且添加功能接收器会导致这种情况发生?

最佳答案

这个问题的公认答案对我不起作用。

以下工作:

...simply changing out the project’s strong key assembly worked in this particular case. If you haven’t had to change this before, it is under the properties of the project -> Signing. Under ‘Choose a strong name key file’, select New. The password is optional.



感谢这篇博客文章: Farm Solution Deployment Problems

关于deployment - 为什么在调试时包中缺少项目的程序集?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10195931/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com