0

I tried to deploy our solution in visual studio while activating the feature it throws an error message like these

Error 2   Error occurred in deployment step 'Activate Features': Failed to load receiver assembly Branding, Version=1.0.0.0,

Culture=neutral, PublicKeyToken=f2aaa83e584920ed" for feature "Branding" (ID: 1c0ad1c9-62f4-4dcf-b092-1aec1c524e47).: System.IO.FileNotFoundException: Could not load file or assembly '.Branding, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f2aaa83e584920ed' or one of its dependencies. The system cannot find the file specified. File name: Branding, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f2aaa83e584920ed'
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()

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].

      0   0   Branding

If I rename the Feature name means it's working sometimes, but first time I deploying the solution means it throwing this error,Please help me to solve this issue

  • Your solution might have dependency on Assembly. So try to put that assembly in GAC. It may resolve your issue. – Amit Nov 17 '16 at 12:14
  • Hi, My solution is already in GAC folder, still, it's throwing the same issue @Amit – Suriya Nov 17 '16 at 12:19
  • Try removing and then adding again using Gacutil – Amit Nov 17 '16 at 12:20
  • I tried, Then also it throwing the same issue bro @Amit – Suriya Nov 17 '16 at 12:26
  • This happens more than you think. To me, this error appear when I change from Release to Debug and viceversa. What I do in this cases is perform a deploy with powershell using -Force attribute. – Marco Nov 17 '16 at 13:03
1

I would recommend try to deploy using the powershell like this

Add-SPSolution -LiteralPath c:\solution.wsp

Install-SPSolution -Identity solution.wsp -GACDeployment

If you dont want to do this then try this

  • Remove feature receiver
  • Clean solution
  • Close Visual Studio
  • Delete SharePoint project's obj folder in Windows Explorer
  • Delete SharePoint project's bin folder in Windows Explorer
  • Open Visual Studio and re-add feature receiver
  • Start Debugging

Check the reference here

Also check this

  • I tried, Still, it's not Working @Waqas – Suriya Nov 18 '16 at 14:45
  • same error? did you stop and start the SharePoint timer service on the SharePoint servers – Waqas Sarwar MVP Nov 18 '16 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.