reading excel files from C# working well in 32 bit version server. It is not working in 64 bit version (Windows 2003 server), because excel data connection dll not supported in 64 bit version. Is any other option available ?
+3
A:
In your project properties set the target platform from 'Any' to 'x86'.
Details:
In Windows x64 a process may be started as 32bit or 64bit process. A 64bit process can only load 64bit dlls and a 32bit process only 32bit dlls.
If your platform target (e.g. specified in the project properties) of your .Net application is set to "Any CPU", the intermediate code will be compiled to 32bit or 64bit code depending on the target platform, i.e. on a x64 system 64bit code will be generated.
Therefore the code can no longer load a 32bit dll.
If your code loads unmanaged assemblies you should always specify the target platform explicitly
0xA3
2009-01-12 13:14:25
Thanks for your response.I have used the MDAC drivers to read the excel file i.e string strConn; strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=C:\\exceltest.xls;" + "Extended Properties=Excel 8.0;"; but MDAC is not available for x64 bit version
guna Samba
2009-01-12 13:59:55
Yes, and because the driver is a 32 bit application you have to make your .NET assembly a 32-bit assembly too by setting the project's target platform to 'x86'.
0xA3
2009-01-12 15:18:01
apart from project target platform, are we need to configure IIS services in production server
guna Samba
2009-01-12 16:28:45
Is the problem not solved by changing the target platform?
0xA3
2009-01-12 22:12:21
how can i change the IIS configuration, I have changed the platform in Dotnet Projects
guna Samba
2009-01-19 07:19:33
cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 “true”
0xA3
2009-01-19 10:58:47
(see http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/405f5bb5-87a3-43d2-8138-54b75db73aa1.mspx?mfr=true)
0xA3
2009-01-19 10:59:22
thanks for your response. I have tried this, but after the mode has been changed. "service unavailable" error has occured while running the application
guna Samba
2009-01-19 16:47:40
I have solved the problem, after enabling the 32 bit mode, we need to register the iisreg for 32 bit and we need to enable the 32 bit mode in web service extension
guna Samba
2009-01-20 14:29:03