in

SDT Community Server

SDT Forums, Blogs, Photos server.

Floating Heart

No description is bad.

IIS: The Application Is Not a Valid Win-32 Application.(Developed on 32 bit, deploy on server 64 bit)

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2104952&SiteID=1

We have Windows XP Professional (32-bit) machines which we use for development purpose, on which we will compile our ASP.Net 2.0 (32-bit) code using Visual Studio 2005, which builds and works really fine on the developer machines.

The Production Server has got Windows 2003 (64-bit) machine, that’s why the code which compiles on the developer machines fails on this server giving error “The Application Is Not a Valid Win-32 Application.

Please help us solve this?

======================================

 In VS2005 one of your build platform options is AnyCPU build your code with that option and you can deploy your code in Win2003 x64, the other option is to use run IIS6 in WOW 64 mode this option runs a 64bit box in 32bit mode so all the benefits of 64bits may not be there so try this only if AnyCPU build option does not solve the problem.  The first two links covers how to run 32bits application in 64bit Win2003 by default you need at least SP1 and the last link covers Reporting services because it is also IIS dependent.  Post again if you still need help.

http://blogs.technet.com/mbaher/archive/2006/12/17/running-iis-32-bit-applications-on-iis-64-bit.aspx

Running IIS 32-bit Applications on IIS 64-bit

Do you have IIS on Windows 64 bit and want to run application that is for 32 bit. No problem. From the Inetpub admin scripts run the following:

"cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 true"

Here are the details.

Windows Server 2003TM, Service Pack 1 enables IIS 6.0 to run 32-bit Web applications on 64-bit Windows using the Windows-32-on-Windows-64 (WOW64) compatibility layer. IIS 6.0 using WOW64 is intended to run 32-bit personal productivity applications needed by software developers and administrators, including 32-bit Internet Information Services (IIS) Web applications.

On 64-bit Windows, 32-bit processes cannot load 64-bit DLLs, and 64-bit processes cannot load 32-bit DLLs. If you plan to run 32-bit applications on 64-bit Windows, you must configure IIS to create 32-bit worker processes. Once you have configured IIS to create 32-bit worker processes, you can run the following types of IIS applications on 64-bit Windows:

  • Internet Server API (ISAPI) extensions
  • ISAPI filters
  • Active Server Page (ASP) applications (specifically, scripts calling COM objects where the COM object can be 32-bit or 64-bit)
  • ASP.NET applications

IIS can, by default, launch Common Gateway Interface (CGI) applications on 64-bit Windows, because CGI applications run in a separate process.

Before you configure IIS to run 32-bit applications on 64-bit Windows, note the following:

  • IIS only supports 32bit worker processes in Worker Process Isolation mode on 64-bit Windows
  • On 64-bit Windows, the World Wide Web Publishing service can run 32-bit and 64-bit worker processes. Other IIS services like the IIS Admin service, the SMTP service, the NNTP service, and the FTP service run 64-bit processes only
  • On 64-bit Windows, the World Wide Web Publishing service does not support running 32-bit and 64-bit worker processes concurrently on the same server


http://support.microsoft.com/default.aspx?scid=kb;en-us;895976

Windows Server 2003 SP1 enables WOW64 compatibility for 32-bit Web applications in IIS 6.0

function loadTOCNode(){}
Article ID : 895976
Last Review : December 3, 2007
Revision : 3.4

SUMMARY

loadTOCNode(1, 'summary');
After you install Microsoft Windows Server 2003 Service Pack 1 (SP1) on the products that are listed in the "Applies To" section, you can configure Microsoft Internet Information Services (IIS) 6.0 to start 32-bit worker processes (W3wp.exe). A 32-bit worker process enables WOW64 compatibility for 32-bit Web applications on a server that runs a 64-bit version of Windows Server 2003. This WOW64 compatibility for 32-bit Web applications lets 32-bit DLLs such as ISAPI Filter DLLs and ISAPI Extension DLLs load in-process.

MORE INFORMATION

loadTOCNode(1, 'moreinformation');
On a 64-bit version of Windows Server 2003 that has SP1 installed, IIS starts a 32-bit worker process or a 64-bit worker process, according to the value in the following metabase property:
W3SVC/AppPools/Enable32bitAppOnWin64
When the value for the Enable32bitAppOnWin64 property is 0, or when the property is missing, IIS 6.0 starts a 64-bit worker process. If the Enable32bitAppOnWin64 property is present and the value is anything other than 0, IIS 6.0 will start a 32-bit worker process.

IIS 6.0 cannot make sure that configured ISAPI Filter DLLs and ISAPI Extension DLLs can actually load in a worker process. You must make sure that only 32-bit ISAPI DLLs are configured to load in a 32-bit worker process or only 64-bit ISAPI DLLs are configured to load in a 64-bit worker process.

If you configure a 32-bit ISAPI Filter DLL to load in a 64-bit worker process or if you configure a 64-bit ISAPI Filter DLL to load in a 32-bit worker process, an error message that is similar to the following may be written to the Application log:
Event Type: Error
Event Source: W3SVC-WP
Event Category: None
Event ID: 2268

Description:
Could not load all ISAPI filters for site/service. Therefore startup aborted.
Data: 0000: c1 00 00 00
If you configure a 32-bit ISAPI Extension DLL to load in a 64-bit worker process or if you configure a 64-bit ISAPI Extension DLL to load in a 32-bit worker process, you may also receive a 500 error response that contains the following text:
%1 is not a valid Win32 application
We also recommend that you use a 32-bit debugger to troubleshoot 32-bit Web applications. Or, use a 64-bit debugger to troubleshoot 64-bit Web applications. The dump file information may not be accurate if you use either of the following methods:
You use a 64-bit debugger to debug a 32-bit process or application.
You use a 32-bit debugger to debug a 64-bit process or application.


http://msdn2.microsoft.com/en-us/library/ms143293.aspx

Published May 22 2008, 04:59 PM by wicky
Filed under:

Comments

No Comments
Copyright SDT, 2006-2009. All rights reserved.