当我在我的功能中没有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
装配Binging日志查看器
* Assembly Binder Log Entry (25/04/2014 @ 11:11:41) *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 (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\SharePoint\vssphost5.exe --- A detailed error log follows.
=== 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 LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = vssphost5.exe
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: GAC Lookup was unsuccessful. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/Decisions.Features.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/Decisions.Features/Decisions.Features.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/VstspCache7880/Decisions.Features.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/VstspCache7880/Decisions.Features/Decisions.Features.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/PublicAssemblies/Decisions.Features.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/PublicAssemblies/Decisions.Features/Decisions.Features.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/Decisions.Features.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/Decisions.Features/Decisions.Features.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/VstspCache7880/Decisions.Features.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/VstspCache7880/Decisions.Features/Decisions.Features.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/PublicAssemblies/Decisions.Features.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/Extensions/Microsoft/SharePoint/PublicAssemblies/Decisions.Features/Decisions.Features.EXE. LOG: All probing URLs attempted and failed.
帮助
答案 0 :(得分:11)
这对我有用,
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.
答案 1 :(得分:1)
这对我有用。
右键单击项目并选择属性。在属性菜单中,选择签名。在签名选项卡中,在选择强名称密钥文件下选择新密钥并键入密钥名称。然后选择不需要密码。完成所有操作后重建文件,您就可以开始部署了。
答案 2 :(得分:0)
这对我有用:在程序集信息中更改VS项目的版本。例如,我将程序集和文件版本更改为1.1.0.0而不是1.0.0.0。
部署并没有问题。
之后我可以将其设置回1.0.0.0并继续部署而不会出现错误或问题......
答案 3 :(得分:0)
另一个对我有帮助的解决方案: 转到要部署到的站点,然后从UI激活功能。 从Visual Studio重新部署。