I just migrated my hosting solution to a new 64 bit server. Once I figured out the process I didn't really have to do anything special other than assign permissions to the correct web user to the files and confirm that I was using the same app pool .NET 2 Classic as on the other server.
Now I am trying to migrate an application with a bunch of custom DNN modules that is in DNN 5 to a new server and can't get it to work. I have the original module developer trying to help with this, but we cannot figure it out.
When I do the simple migration using the existing app pool and assign the correct permissions I initially get this error related to the ABCPDF tool we use to merge a group of reports into a single report.
Required permissions cannot be acquired. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
[PolicyException: Required permissions cannot be acquired.] System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +7608739 System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +57 [FileLoadException: Could not load file or assembly 'ABCpdf, Version=6.1.0.7, Culture=neutral, PublicKeyToken=a7a0b3f5184f2169' or one of its dependencies. Failed to grant minimum permission requests.
So I did some research and found that the ABCPDF version 6 that we used doesn't work on 64-bit. We built this several years ago. Now there is a version 8 of ABCPDF that is 64-bit compliant. If I just try to copy the ABCPDF version 8 DLL that works with 64-bit into the bin folder I get this error below. I also get the same error if I just try to remove the ABCPDF.DLL from the bin folder.
Unverifiable code failed policy check. (Exception from HRESULT: 0x80131402) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Unverifiable code failed policy check. (Exception from HRESULT: 0x80131402)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[FileLoadException: Unverifiable code failed policy check. (Exception from HRESULT: 0x80131402)] System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0 System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43 System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127 System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142 System.Reflection.Assembly.Load(String assemblyString) +28 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
[Configurati sException: Unverifiable code failed policy check. (Exception from HRESULT: 0x80131402)] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178 System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54 System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +600 System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +125 System.Web.Compilation.BuildManager.CompileResourcesDirectory() +31 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +304
[HttpException (0x80004005): Unverifiable code failed policy check. (Exception from HRESULT: 0x80131402)] System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729
[HttpException (0x80004005): Unverifiable code failed policy check. (Exception from HRESULT: 0x80131402)] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8921835 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259
Version Information: Microsoft .NET Framework Version:2.0.50727.5466; ASP.NET Version:2.0.50727.5456
So I am not sure if the Unverifiable code failed policy check is totally unrelated to the ABCPDF DLL, or if it has to do with setting a reference in the VS solution or something else. If just copying in the new DLL is resolving the ABCPDF issue and this is something totally unrelated, do you have any idea what it is? I looked at a ton of related posts in Google but nothing specific is jumping out at me. It seems like it might have something to do with moving from a 32-bit server to a 64-bit server. But I am not sure.
I also did a DNN 6 upgrade on this site and tried to migrate that version but I got the exact same errors.
Thanks for any ideas you might have.
|