How can I force IIS Express to run in 32 bit mode? - iis-express

I have a classic ASP app that I'm trying to run under IIS Express on 64 bit Windows. It uses Jet to connect to a Microsoft Access database and will not work under 64 bit.
I have created the following application pool for the ASP app, but it seems to ignore the enable32BitAppOnWin64 attribute and the process is still 64 bit.
<applicationPools>
<add name="UnmanagedClassicAppPool32" managedRuntimeVersion="" managedPipelineMode="Classic" autoStart="true" enable32BitAppOnWin64="true" />
</applicationPools>
How can I get this app pool in IIS Express to run as a 32 bit process?

For Visual Studio 2013
Visual Studio 2015
Visual Studio 2017
Visual Studio 2019:
Tools
-> Options
-> Projects and Solutions
-> Web Projects
-> Uncheck "Use the 64 bit version of IIS Express for web sites and projects"`

According to this, IIS Express 7.5 comes only as a 32 bit application. IIS Express 8.0 however, comes with both 32 bit and 64 bit versions of the application. The 32 bit version can be found at c:\program files (x86)\IIS Express\iisexpress.exe and the 64 bit version can be found at c:\program files\IIS Express\iisexpress.exe.
IIS Express ignores the enable32BitAppOnWin64 attribute. To run the app pool as 32 bit, you must execute the 32 bit version of IIS Express.
You can determine which version is running in Task Manager by examining the process on the Processes tab. The 64 bit version will be displayed as iisexpress.exe and the 32 bit version will be displayed as iisexpress.exe *32.

Add <Use64BitIISExpress>false</Use64BitIISExpress> under the <PropertyGroup> tag of your csproj project.
It's also available through the UI by clicking on project properties -> Web tab -> Bitness (change to x64).

In IIS Express property window of VS studio, change the first option: 'Managed Application Pool' from 'Integrated' to 'Classic'

Are you sure?
It uses Jet to connect to a Microsoft Access database and will not work under 64 bit.
I had the same problem and eventually solved it by forcing the 64 bit drivers to install. Initially that failed because of an error that you can't install the 64 bit drivers if you have Office 2010 32 bit installed.
But ... you can force the 64 bit version of the Access Database Engine (ACE) from here to install with the 'passive' switch:
AccessDatabaseEngine_x64.exe /passive
And then I was able to run my legacy code with my current development environment.

Related

Problem with Visual Studio when run on another pc

i have problem in Visual Studio 2019 when i run my project in my pc. It can run very well. But when i share my project to my instructor, she couldn't run it and error was occur. The error said " 'Microsoft .ACE.OLEDB.12.0' provider is not registered on local machine. any solution from this problem?
She needs to install the ACE drivers freely downloadable from Microsoft. See https://www.microsoft.com/en-us/download/details.aspx?id=13255
You need to ensure that if you compiled your project as x86 (32 bit) the the 32 bit ACE driver needs to be installed? If compiled as 64 bit, then 64 bit ACE driver should be installed.

32 bit oracle libraries working in Visual Studio but not SSMS

I have an SSIS package that I've developed in Visual Studio 2015.
The package is connected to an Oracle DB and a local SQL Server DB as input and output respectively.
I had some issues connecting the package to the Oracle client in the past due to 32 vs 64 bit compatibility issues (machine is 64 bit, Visual Studio is 32 bit).
I fixed that by installing both 32 and 64 bit oracle libraries on my machine and changing the Project property 'Run64BitRuntime' to False.
However, I've now exported the project as a .ispac file to SSMS to try schedule it. However, I'm getting the error I had with Visual Studio a while back, "Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit oracle client components installed".
Visual Studio and SSMS are both 32 bit applications, so why is this issue popping up again? My project should be set to use 32 bit libraries by the looks of it and runs fine in VS.
Does SSMS have it's own toggle for which driver to use?
Ok I managed to solve the problem somehow. You can change the package execution settings in SSMS under advanced settings.
You can also choose what settings you want to run in a scheduled job so this allows me to run all the packages at 32-bit runtime.
Picture here showing which option

Oracle.DataAccess not available for selection in Visual Studio 2013

I've recently set up a Windows 8.1 64 Bit Machine with Visual Studio 2013 (probably 32 bit, at least it installed itself at Program Files (x86)).
I've also installed the Oracle 11.2.0.1 64 Bit Client with Oracle Data Provider for .NET.
When I do gacutil /l | findstr Oracle.DataAccess, I get four entries, including the following:
Oracle.DataAccess, Version=2.112.1.0, ..., processorArchitecture=AMD64
However, I cannot find Oracle.DataAccess in any of the lists when trying to add an assembly (Oracle.Web is present under Assemblies->Extensions, though).
Do I have to install the 32 bit Oracle Client (or simply 32 bit ODP.NET) as Visual Studio is 32 bit? If so, will the software be able to run on a 64 bit system with a 64 bit application and 64 bit Oracle Client (with 64 bit ODP.NET)?
Yes, Visual Studio is an 32bit application.
It depends on your compilation target (x86 or x64 or AnyCPU) which Oracle Client you need for running/debugging your application, regardless of the architecture from Visual Studio.
AnyCPU will run as 64 bit on a 64 bit Windows (which is most likely the case)
Oracle.DataAccess does not appear because it is an 64bit assembly but your Visual Studio is 32bit.
There are several solutions:
In Add References use the Browse section and locate Oracle.DataAccess.dll manually. Typically you will find it in folder %ORACLE_HOME%\odp.net\bin\2.x\ or %ORACLE_HOME%\odp.net\bin\4\
Open your *.csproj, resp. *.vbproj file with a text editor and add reference manually, i.e. add lines like this under element <ItemGroup>:
<Reference Include="Oracle.DataAccess">
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
Note: attributes like Version=... or processorArchitecture=... are not required. Your application will load the correct Oracle.DataAccess.dll depending on selected architecture and target .NET framework (provided that it is installed properly - also on your target machine)
Install both x86 and x64 Oracle Client on your machine. Here is an instruction how to do this: Stack Overflow - Install Oracle x86 and x64
Use the ODP.NET Managed Driver from Oracle. You can download it from here: 64-bit Oracle Data Access Components (ODAC) Downloads This works also with 32bit applications.
Open your Registry editor and check if RegKey HKLM\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\ODP.NET resp. HKLM\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\ODP.NET exist. Both RegKeys contain only the (Default) value with location of your Oracle.DataAccess.dll.
Example:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\ODP.Net]
#="c:\\oracle\\product\\11.2\\Client_x86\\odp.net\\bin\\2.x"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\ODP.Net]
#="c:\\oracle\\product\\11.2\\Client_x86\\odp.net\\bin\\4"
Check your target Framework in compile options. When you have ODP.NET version 4.x installed you must select target .NET Framework 4 or higher in order to see the ODP.NET entry in reference list.

How do I get IIS Express to launch MVC3 web application with 64 bit 3rd party DLLS

I referenced a DLL in a MVC3 web application.
It compiled successfully.
MVC3 project is running as Any CPU configuration property.
I launched IIS Express 7.5 and I keep seeing the DLL is missing its dependencies exception.
I then created a windows application and referenced the DLL and it worked fine.
So I realise it's something to do with IIS Express setting.
Dll is 64 bit.
Can you please guide me
IIS Express 8 has a 64 bit and a 32 bit version, which are both installed on a 64 bit machine.
See this question on how to run IIS Express in 64 bit mode, and then attach to process to debug.
See the answer to this question. IIS Express 7.5 is a 32 bit application only so there is no way to get it to work with 64 bit DLL's. The same goes for the Visual Studio Development server.
You'll have to host your site in the full version of IIS for it to run. You can set that up by choosing "Use Local IIS Web server" in the Web section of the project properties.
IIS Express 7.5 runs only as 32bit process. To run 64bit app, you should use full version of IIS.
Make sure that build configuration is set to “Any CPU" for your MVC app.
and also make sure that your application app pool set to run in 64 bit mode. Run the following command to do that
appcmd set apppool /apppool.name: /enable32BitAppOnWin64:false

Can not access an EXCEL file on a 64-Bit Windows 7 with Visual Studio

my Windows 7 is 64 bit. My Visual Studio project is target to x86. I have installed this:
http://www.microsoft.com/downloads/en/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&displaylang=en#Requirements (the x32 version).
I get this error message: The 'Microsoft.ACE.OLEDB.14.0' provider is not registered on the local machine.
What do I wrong?
When you build the project you need to specify that you're specifically targeting x86 CPUs, not Any CPU.
I don't have VS 2010 installed here, so can't tell you exactly what to do, but either . . .
From the drop down that says "Any CPU" select x86.
Or on your project properties page (of the exe project) select "x86" for "Platform Target"
You need to take a look at 32-bit Microsoft ODBC Administrator to register the 32-bit driver. The one under Adminsitrative Tools is 64-bit only. Go to Windows\System32\, the search for odbcad32.exe. Click on System DSN, and register the 32-bit driver.
I'm using "Microsoft Access Database Engine 2010 Redistributable" in Win 7 64 bit without any issue. Try to install 64 bit version of "Access Database Engine".
I've got the following configuration
Win 7 64 bit
VS 2010 32 bit (there is no 64 bit)
Microsoft Access Database Engine 2010 Redistributable 64 bit
Cheers...
Muse Extensions

Resources