Running my website in a 32-bit application pool on a 64-bit OS

Here is my setup:

Dev: - 64-bit version of Windows Server 2008 - Visual Studio 2008 - Solution with 3 class libraries, 1 web application

Web Server: - 64-bit version of Windows Server 2008 R2 - Integrated IIS7.5 application pool with 32-bit applications enabled

In Visual Studio, I installed all 4 of my projects to compile to Any Processor, but when I run this web application on a web server with a 32-bit application pool, it shuts down and resets. When I run the application pool in 64-bit mode, it works fine. The production web server requires me to run the 32-bit application pool on a 64-bit OS, so I configured it this way on the intermediate web server.

(I was considering publishing to ServerFault, but part of the server is working fine. It is my code that doesn’t specifically work in the 32-bit application pool, so I post it here.)

Edit: Event Viewer Error

Faulting application name: w3wp.exe, version: 7.5.7600.16385, time stamp: 0x4a5bcd2b Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdbdf Exception code: 0xe053534f Fault offset: 0x0000b727 Faulting process id: 0x%9 Faulting application start time: 0x%10 Faulting application path: %11 Faulting module path: %12 Report Id: %13 
+4
source share
8 answers

Unfortunately, I do not think anyone could understand this. The two DLLs that I used came from the downloaded ZIP file, and when I went to the properties of these files, a box appeared that said they were downloaded from the Internet, and I had to "unlock" them. It seems that the 64-bit application pool did not comply with this, but when I fell to 32-bit, it happened. As soon as I "unblocked" the DLL, everything began to work fine.

+4
source

I had a similar error in the application that I was working on ... if I built the assembly for the target x86, it worked fine. I had problems when I aimed at "Any processor."

+2
source

I assume that 64-bit can work with both 64-bit and 32-bit code, but 32-bit can only run 32-bit code.

If you want to run code compiled by a 64-bit compiler in a 32-bit window, you need to compile your code using a 32-bit compiler.

+1
source

For each project, try the following:

1) Right-click on the project and select "Properties".

2) Select the “Assembly” tab on the left side

3) Select x86 for the target platform

4) Restore

+1
source

I believe the error indicates an attempt to load a 64-bit dll into a 32-bit process. All your projects can be configured to "Any processor" (or x86), but I bet you are referring to a 64-bit dll. Are you using any third-party libraries for which you have included a 64-bit DLL?

It is possible to exchange 32-bit / 64-bit links on the fly depending on the current computer environment by modifying .csproj files and using the msbuild script bit. If you are interested in how this can be done, let me know and I will send the following information.

+1
source

Your post is a bit confusing.

Does any X64 processor work?

Any processor - X64 + 32bitCompat not working?

If so, it appears to be a discrepancy between the libraries used. The runtime may be interpreted as x64, but is fed by x86 libraries. It is important that they are consistent.

You must create new configurations for x64 and x86 (or just x86) and deploy them as needed. In my experience, using "Any CPU" leads to this bad and ugly road.

+1
source

In my case, the problem was caused by the wrong version of the third-party DLL in the client bin folder.

I have version 10.3 and 11.1 of Infragistics installed on my computer. My project has a link with version 11.1, but in the bin folder of my client there is only Infragistics 10.3.

Since I have both versions installed on my computer, I have no errors when creating the application. The reason is that I can determine where a good version of Infragistics is; in the PAC. But for a client who does not have Infragistics installed, I get the same error as in the question about this message.

+1
source

The same (general) exception code, but a problem occurred to me if I tried to authenticate using the admin user account (for my 32-bit .net 2 application on IIS 7 on 2k8R2). If I created a local user and added him to the Builtin \ Administrators group, and then logged in with this account, the application worked fine. Even if the domain administrator is automatically part of the built-in \ administrators. Hope this line of thinking and not relying on domain administrator accounts helps someone else.

0
source

Source: https://habr.com/ru/post/1306635/


All Articles