What would be the best (easiest and fastest) way to provide an access between 64-bit application (ASP.NET) and 32-bit assembly (.NET 32-bit database driver).
1) I've got complete control over this two pieces of code (64-bit and 32-bit),
2) They both run on the same machine,
3) Security is not an issue,
4) Performance is important.
Run the ASP.NET application processes in 32-bit mode. This is the only way to get it to work.
For example, Crystal Reports XI does not have a 64-bit driver. In order to run the report, you must run the ASP.NET app in 32-bit mode on a 64-bit server.
On IIS 6.0:
Click Start, click Run, type cmd, and
then click OK.
Type the following command to enable
the 32-bit mode:
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools Enable32bitAppOnWin64 1
Now since the IIS worker process is
running in 32 bit mode we need to
ensure the ASP.NET ISAPI filter is
also changed to the 32 bit version.
Type the following command to install
the version of ASP.NET 2.0 (32-bit)
and to install the script maps at the
IIS root and under:
%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe –i
In IIS 7.0, you can set the 32 or 64-bit per application pool whereas on IIS 6.0 it's the entire processes of the server.
Related
I have a .NET C# WebAPI application which is meant to run on IIS. The app loads an external 64 bit DLL. When I debug on VS2015 everything is fine, but I had to set this checkbox in order to make it work:
Now, I deployed the application on a Windows7 VM running IIS version 7.5 and I get the same error as if I haven't set that checkbox on VS2015. Is there any equivalent setting in IIS in order to force 64 bit mode?
I have MVC application. I need whatever it was in the x64. I have local iis with x64 OS. When I publish the project in Visual Studio I choose x64 configuration. When i set the value of “Enable 32-bit Applications” to False in IIS AppPool settings everything works well, but when i set the value of “Enable 32-bit Applications” to True i get an error.
How can I publish x64 project to IIS server with “Enable 32-bit Applications” = True?
I still have a problem. I can not even run a standard initial application. here's a screencast (sorry that the IIS have russian interface): http://www.screencast.com/t/Kf0mpM9uFa
what am I doing wrong?
And sorry for my English. Bears, vodka, balalaika.
Thanks in Advance.
It’s because you are trying to run 32 bit dlls on a 64 bit system. Fix it in IIS manager by changing the advanced settings on you application pool to enable 32 bit applications. Or create a new app pool specifically for them.
original artcle
I got a simulation:
1. Project platform target x64 => Working in IIS.
2. IIS > enable 32bit application = > Working also.
My Idea is:
Kindly check framework of your application pool.
The application and all of its libraries are compiled with Platform AnyCPU and Prefer32Bit off. The application loads its libraries from embedded resources, using the currentDomain.AssemblyResource event.
The application is deployed to over one hundred PCs, running Windows 7, Vista, 10, 2008 and 2012. But on some Windows 7 Enterprise 64-bit PCs (not all of them), when the application loads the embedded class libraries the BadImageFormatException is thrown. The JIT compiler is somehow resolving on those PCs to compile the class library to 32 bit instead of 64 and since the hosting application was compiled to 64 bit the exception is thrown.
What other factors will the JIT compiler use in addition to the ones listed above (OS 64 bit, AnyCPU and Prefer32Bit off) to decide in only a few PCs to select 32 instead of 64 bit when loading the class library?
One possibility is that .NET-64 is disabled on an x64
From: https://stackoverflow.com/a/14857294/97471
There's a setting that can force AnyCPU assemblies to run as 32-bit on
x64 OS. Use ldr64.exe from .Net2 x64 directory to check the status:
C:\Windows\Microsoft.NET\Framework64\v2.0.50727>ldr64.exe query
loading kernel32...done. retrieved GetComPlusPackageInstallStatus
entry point retrieved SetComPlusPackageInstallStatus entry point
Current status is: 0x00000001 1 - means 'run AnyCPU as 64-bit' 0 -
means 'run AnyCPU as 32-bit'
Though I didn't find such utility in .Net v4 folder, the setting
applies to Net4 AnyCPU assemblies as well. This flag is saved in DWORD
registry value Enable64Bit under the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework
This setting seems to be loaded on OS start, and changing only
registry value doesn't affect applications until reboot. Changing the
flag with ldr64.exe affects immediately.
Note that this setting is system-wide. By default Enable64Bit is set
to 1. It seems that some application reset it to 0, and reverting the
value back can cause problem to that app.
I am getting this error when i am trying to install VS project in a 64 bit System. I already download and install AccessDatabaseEngine . There is any other method to do that, i am using MS Access(Office 2007) database to my application. both systems are using x32 system tools **. if i am installing **AccessDatabaseEngine(x64) it is getting an error your system consists of (x32 system tools)
Try to find out your solution from here
For Web
If you have installed the AccessDataEngine and are still getting the Not Registered error
AND
you are running IIS7 on a 64 bit server,
MAKE SURE
you have enabled 32-bit applications for the application pool associated with the website. In IIS, Right click on the application pool. In the properties window, the 2nd option from the top is "Enable 32-Bit Applications". Set it to true.
I have installed the 'Microsoft Access Database Engine 2010 Redistributable' as described in the blog entry
http://danielcai.blogspot.com/2011/02/solution-run-jet-database-engine-on-64.html
and it works in my windows-forms application. I now want to add some unit-tests and when running the unit-test I get the above error. I have checked my references but can't seem to figure out why it works in the application and not in the unit-test.
I'm working in VS2010 on a windows 7 ultimate x64 installation.
Can someone please help me ?
The Target Platform is probably set to Any CPU, which means when you run it from VS or in your 64-bit Windows it will execute as 64-bit code (and use the 64-bit Jet driver). But a typical unit test runner is executing in 32-bit mode and all assemblies it loads will then execute in 32-bit mode (since your project target platform is Any, ie either 32 or 64 bit). And Windows 7 does not come with a 32-bit Jet driver by default.