Question

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

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top