Running 32 bit application in 64 bit server? - asp.net

We have developed a web application . It contains large amount of Data .So I need to enable 64 bit application in IIS application Pool (ie . Disable 32 bit application ). I have some regression due to enabling the 64 bit. I have added some dll with 32 pit application .Now its not running. Is there any solution to run 32 bit application in 64 bit application. Is there any work around process to resolve this regression.
advance in thanks

This is typical issue when you have to use 32-bit DLL in your project. The solution is dead simple - move 32-bit code out into separate process and communicate to it with any means you're familiar with. I prefer WCF with named pipe binding - the fastest option within the same machine.

Related

Configuring IIS 7 to run on 32 bit

I understand that the server can't run 32 bit and 64 bit apps concurrently, but I need to make use of the wkhtmltopdf utility which is only available as a 32 bit binary. If I "downgrade" my environment to 32 bit (ASP.NET app, IIS), what affect will this have on performance? Will it break anything?
".. the server can't run 32 bit and 64 bit apps concurrently"
You can have an application pool running in 32 and another in 64 bits in the same IIS instance.
https://help.webcontrolcenter.com/KB/a1114/how-to-enable-32-bit-application-pool-iis-7-dedicatedvps.aspx
Create a dedicated application pool to run this application, leave all other apps in 64 bits mode

How to run VS 2010 Local IIS in 32 bit mode

I have referenced some 32 bit and some 64 bit DLL in my ASP.NET MVC 3 project.
The projects compile but I get runtime errors.
It's because I am running the web project as 64 bit.
How do I "enable 32 bit" in my local IIS (just how I can do it in IIS 7.5 Pro)?
I am using .NET 4.0
The error I get is:
Retrieving the COM class factory for component with CLSID {A6775dfd2-1dfF-421C-A187-4D55F4DDFBFF} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
If you don't require the 64 bit component (not sure what is running there or if this can be excluded as you simply wanted to know how to run in 32 bit more)
http://learn.iis.net/page.aspx/201/32-bit-mode-worker-processes/
You can set it at the server level via:
%windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.enable32BitAppOnWin64:true
Or set your particular app pool (more recommended imho) you can try the following. Sorry the page this came from is no longer seemingly active and only googles caches is showing it now:
Force IIS to create a 32-bit app pool worker process
If your application is running as a web app, meaning it is running in
an IIS app pool worker process, you’ll want that worker process
(w3wp.exe) to be a 32-bit process. That can be specified in the
advanced settings of the app pool:
Select the app pool for your web app. Click Advanced Settings… under
Edit Application Pool on the right. Change the value of Enable 32-Bit
Applications under (General) to True.
Note that the word “Enable” in the setting doesn’t mean “allow” as in
“allow either 32- or 64-bit applications.” It actually means “force”
as in “force the worker process to run in 32-bit mode so that 32-bit
applications are supported.” This means that the app pool worker
process will always be launched as a 32-bit process when this setting
has a value of True. Setting it to False will launch a 64-bit app
pool worker process.
Note that when an app pool worker process is started, it shows up in
the Image Name column on the Processes tab in Task Manager as
w3wp.exe. When the Enable 32-Bit Applications setting has a value of
True, it will be listed as w3wp.exe *32.
IIS Express 7.5 (as used by Visual Studio 2010 if you install it) is 32 bit only:
http://learn.iis.net/page.aspx/1265/iis-75-express-readme/
To quote:
Both 32-bit and 64-bit systems are supported, however only a 32-bit build of IIS 7.5 Express exists.
So I can't imagine that your problems would be related to the usual 32bit / 64bit pool mode issues that can arise if all of your DLL's are 32bit.
However if you're trying to load a 64 bit COM DLL then this will fail; 64 binaries can't be loaded into a 32 bit process and vice versa.
Another gotcha is forgetting to tick the Use IIS Express checkbox when choosing which web server to debug with:
If you don't tick that checkbox then you'll run your site in a child application in the DefaultWebSite on the version of IIS7 that ships with Windows.
The DefaultWebSite runs in the DefaultAppPool, which in 64 bit versions of Windows runs as a 64 bit process. So you need to change the DefaultAppPool to run as 32 bit if you want to use this instead and consume 32 bit binaries.
You need to do this using IIS7's MMC snap-in or by running the appcmd.exe tool from the command line.
Set your compile target to x86 instead of AnyCPU or x64. Your dll will always run in 32-bit without you needing to mess with the IIS server settings.

Is it possible in Windows 7 64 bit to use 64 bit com dlls (in process servers) from a 32 bit exe application?

Is it possible in Windows 7 64 bit to use 64 bit com dlls (in process servers) from a 32 bit exe application?
I need to leave my VB6 gui application as 32 bit running on a windows 7 system but it has calls to com dlls (in process servers) and com exe's ( out of process servers).
My understanding is that it should have no problem with the com exe's the out of process servers.
I think the com dll in process server may have trouble since it is 64 bit but the application calling it is 32 bit.
Has anyone used a 64 bit com dll from a 32 bit application?
Thanks
A solution to this is discussed here:
https://stackoverflow.com/a/8484244/147637 (Read the whole post)
Years ago I used a 32bit DLL in a 16bit app. I don't remember how we did it (and the technique would surely not still be applicable), but this is generally called "thunking".
A quick Google would appear to indicate this can't be done in process, but I only scanned:
http://www.google.com/search?q=thunking+64bit+32bit+dll

Classic ASP on large memory server

I have a client with a large ASP app that apparently is fairly memory intensive. I’m helping them migrate to new hardware they have running Win2k8 R2. They have 4 physical servers with 32gb of RAM each. I’m making the assumption that ASP apps run as a x32 process. So I see that we have two options:
On the application pool enable web gardens.
Use the physical servers as VM hosts and split the box into say 4 web servers each.
Any thoughts on which path will provide us better performance? I’m just not really sure how ASP will handle a machine with lots of memory, and I’m worried it won’t really be able to address the memory well. (you can ignore all the obvious stuff like increased maintenance of 16 web servers vs 4, or the flexibility virtualization gets us over physical servers, etc)
It doesn't necessarily follow that an ASP app will require a 32bit process. The common APIs such as ADODB are available in 64 bit so there is a possibility you could run it in a 64 bit process which is certainly worth pursuing first.
When it comes to Web Gardens and ASP if the ASP application makes use of the Session object then you are in trouble. Unlike with Windows Load Balancing there is no way to affiliate a session with a specific process. So if you do need the Session object that just leaves you with VM hosts.
If you can run without Session object the a Web Garden approach is going to be better than multiple VMs.
You might want to double check that assumption about 32 bits: See also this question

Memory Leak in Oracle Client 10.2.04 for 64bit ASP.NET application

Does anybody know of Memory Leak in Oracle Client 10.2.04 64bit?
We use in on ASP.NET application running on Windows 2008 server with
System.Data.OracleClient and our process is growing to 2.4GB withing few days!
Can you test this on a 32bit client somewhere? Has the app worked in other environments, e.g., is this a sudden onset associated with migrating to 64 bit software? Is this an in-house developed app? Before I would point to Oracle, I'd suspect my own code. Particularly with something as egregious as this appears to be! Make sure there are no loops that open cursors inside and never close them.

Resources