Could not load file or assembly 'EntityFramework' or one of its dependencies. The assembly may have been tampered with

3

I am trying to Publish my Webforms project through Visual Studio 2012 to my host 1&1. My web project works fine on local, zero issues. It successfully builds and publishes, however, I get the following error when entering the domain url.

Could not load file or assembly 'EntityFramework' or one of its dependencies. Strong name signature could not be verified.  The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)



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



[FileLoadException: Could not load file or assembly 'EntityFramework' or one of its dependencies. Strong name signature could not be verified.  The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)]

[FileLoadException: Could not load file or assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Strong name signature could not be verified.  The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +16
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38

[ConfigurationErrorsException: Could not load file or assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Strong name signature could not be verified.  The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)]
 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +752
 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +218
 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91
 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +258
 System.Web.Compilation.BuildManager.ExecutePreAppStart() +135
 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516

[HttpException (0x80004005): Could not load file or assembly 'EntityFramework,      Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Strong name signature could not be verified.  The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)]
 System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9874840
 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Please advise, I have searched and searched to no end! - I am struggling to resolve this issue and what to look for.

c#
asp.net
webforms
asked on Stack Overflow Oct 30, 2013 by KyleK

2 Answers

1

It seems that your host 1&1 doesn't install .Net 4.5. You need this version of .Net if you want to use EF 5.0.0.0.

answered on Stack Overflow Oct 30, 2013 by CodeNotFound
1

In my case, the digital signature of the entityframework.dll file was not recognized,

I solved the problem by uninstalling and reinstalling the NUGET entity framework package, republished the project and everything reworks. (if you dont use nuget you can remove the reference and re-add it)

answered on Stack Overflow Apr 7, 2016 by Chtiwi Malek

User contributions licensed under CC BY-SA 3.0