Hi guys
you may face similar error during deployment-"Error 46 Error occurred in deployment step 'Add Solution': Failed to create receiver object from assembly "xyz.abc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d7d9dedsssef903c1", class "xyz.abc.Features.WalesEventReceiver" for feature "xyz.abc_Wales" (ID: 0a24487f-ee53-ddd31d-0fd595c7297f).: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'xyz.abc.Features.WalesEventReceiver' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'xyz.edf, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2be929392a22d4bb' or one of its dependencies. The system cannot find the file specified.
File name: 'xyz.edf, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2be929392a22d4bb'
at xyz.abc.Features.WalesEventReceiver..cctor()
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].
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()
0 0 xyz.abc
you may face similar error during deployment-"Error 46 Error occurred in deployment step 'Add Solution': Failed to create receiver object from assembly "xyz.abc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d7d9dedsssef903c1", class "xyz.abc.Features.WalesEventReceiver" for feature "xyz.abc_Wales" (ID: 0a24487f-ee53-ddd31d-0fd595c7297f).: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'xyz.abc.Features.WalesEventReceiver' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'xyz.edf, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2be929392a22d4bb' or one of its dependencies. The system cannot find the file specified.
File name: 'xyz.edf, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2be929392a22d4bb'
at xyz.abc.Features.WalesEventReceiver..cctor()
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].
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()
0 0 xyz.abc
"
Solution:
This happens just because there is no assembly reference in Assembly folder. You just add the missing dll in assembly file on which your solution is depending.
Thanks
pradeepa achar
Comments