I have a ASP.NET 3.5 application that includes a 32-bit DLL. It works fine (and has for years) on Windows XP, 7 and 10. I am adding support for Windows 2012, 2012 R2 and 2016. It works on 2016, but does not work on 2012 R2.
At the first call to the DLL, the following error occurs:
BadImageFormatException: An attempt was made to load a program with an
incorrect format. (Exception from HRESULT: 0x8007000B)
The same build and install script is used for all OS's tested. Each OS is on a VM on the same machine, so the hardware for all OS's is identical. For each OS:
OS is fully updated.
vcredist 9.0 (x86) is installed as part of the installation.
IIS DefaulatAppPool has 32-bit applications enabled.
I've tried all the suggestions in the posts I've found on this problem, but nothing works. Any ideas?
Double check in Task Manager that your W3WP.exe process for the application is running 32-bit and that it is in fact Default App Pool that is trying to load the DLL. This error message almost certainly means 64-bit process trying to load 32-bit DLL.
Related
My application starts fine on my Windows 8 laptop.
However I can not start it on Windows Server 2008 R2. Following error occured:
The exception unknown software exception (0xe0434352) occured in the application at location 0xfd5ecaed.
The following is printed in the command line:
Unhandled Exception: Cannot print exception string because Exception.ToString() failed.
My solution contains one c++-cli project which i'm trying to use, and if I do not use it then everything works fine, so commenting just this line helps:
// private static CliAdapterMain cliAdapter = new CliAdapterMain();
I've tried:
repair .NET Framework 4.5 on target machine
repair/reinstall VS 2012 Update 1 Redistributable (both x86 and x64, version 11.0.51106.1)
updated my VS2012 to Update 1 recompiled project
no Windows pending updates, tried to reboot system several times
Dependency Walker claims that following DLL's are missing: GPSVC.DLL IESHIMS.DLL MF.DLL MFPLAT.DLL MFREADWRITE.DLL WLANAPI.DLL However they exist on target computer, for example here
c:\Windows\winsxs\amd64_microsoft-windows-grouppolicy-base_31bf3856ad364e35_6.1.7601.17514_none_8649674dfda23046\gpsvc.dll
Probably I can try manually reregister missing dll's, but i don't think this is really a problem. Looking at an exception it seems that something is broken, not something is missing.
upd: From Windows logs:
Va.MBClient.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.TypeInitializationException
Stack:
at Va.MBClient.Program.Main(System.String[])
So I guess that private static CliAdapterMain cliAdapter = new CliAdapterMain(); is failed but i don't know why.
upd played with my application a little. Finally i've found just one line of code that causes a failure. This is #include <boost/thread.hpp>. Why this doesn't work? I'm using latest version of boost (1.52), but i did built it on my Windows 8 machine. Should I rebuilt everything for Windows Server 2008 R2? Should I built entire project on Windows Server 2008 R2?
It is due to in the Windows Sever, some features is not enabled by default, you need to add the Windows Media Services and Wireless LAN Service by yourself to get the Dll back.
You can reference to MSDN
How can I check what version of Windows Imaging Component is installed on a Windows machine? I suspect the Windows 2008 Servers used in Azure do not have the same version that I have on my Windows 7 development machine. I just want to verify that as I need the latest TIFF codec.
Will not make a definite statement, but I think that the WIC on the Windows Azure is the same what you have on your Windows 7. Just be aware that there are 2 OS families in Windows Azure. OS Family 1.x is using Windows Server 2008 SP1 as base, while OS Family 2 is using Windows Server 2008 R2 as base.
From what I read about WIC, I see it is part of Windows 7 / Windows Server 2008 R2, so, if you target your application for OS Family 2, you shall nothave issues. Unless there is some update, or more recent version which has installer. If there is an installer, you can simply use a startup task to install the exact version you need.
UPDATE
Refering this post confirms that Windows 7 / Windows Server 2008 R2 come with WIC. While a platform update is required for Windows Vist / Windows Server 2008 (you must install Server 2008 SP2 before the update is available). So, if you target OS Family 2.x (recommended anyway) you get the same WIC you get in your Windows 7 machine.
Possible or not?
I know Sharepoint 2010 Server won't even run on a client side of Vista/Windows 7 64-bit, forget about Windows XP 32-bit.
But if I can install and use Visual Studio 2010 on Windows XP just fine, shouldn't Sharepoint development tools also work on Windows XP 32-bit?
The thing is I have a very old laptop (from 2005) that doesn't even support 64-bit architecture so I am stuck with WinXP 32bit.
If there is any way at all of (Remote?) Sharepoint development on Windows XP 32-bit with VS2010 please let me know.
Most of what the developer tools offer you make two assumptions:
You are running on a 64-bit architecture
SharePoint is installed side-by-side with Visual Studio
Running on a 32-bit XP machine breaks these assumptions. Many of the built-in Visual Studio productivity aids, such as the deploy and retract commands, will fail. I couldn't even create a project using the SharePoint 2010 project template under similar conditions.
You might make some headway by using regular class library or web application projects, copying SharePoint .dll's from a server's GAC (for use as references) and by manually creating your .ddl and .wsp files using MakeCab (as I did with 2007, with a little help from PowerShell); however, it sounds excruciating compared to running on Vista SP2 X64 or Windows 7 X64 with SharePoint installed.
As per the above answer, VS 2010 SharePoint projects require a local installation of SharePoint. You can use external tools for doing your development, such as WSPBuilder, but I do not recommend this approach. You are best sticking to the MS tools.
Your options are:
Upgrade to Windows 7 x64 or Server 2008 R2
Run VMWare Server (free) which should enable you to run a 64-bit VM on a 32-bit host (I think? Not sure about this assumption actually), and create a VM with Win7 x64 or Win 2008 R2 for SP development.
You can use Win7 64bit as your dev environment
http://msdn.microsoft.com/en-us/library/ee554869.aspx
Currently I have a set of web applications that need to be installed (using IIS). They can only run in 32-bit mode so requires IIS to be set to run 32-bit apps. The steps that we've taken to do this work for server 2003 64-bit, and 2008 64-bit, but does not work on server 2008 R2 64-bit. I've spent many hours on this and I'm stumped.
The following are the steps performed to get the web apps installed:
1. Set "enable32BitAppOnWin64" app to true
2. Uninstall old ASP.NET stuff using 32-bit version of aspnet_regiis.exe: "aspnet_regiis -ua"
3. Install ASP.NET stuff using 32-bit version of aspnet_regiis.exe: "aspnet_regiis -i -enable"
As mentioned before, the above works fine on server 2003 64-bit and server 2008 64-bit, just not server 2008 R2 64-bit. Steps 2 and 3 give me the error: "Operation failed with 0x8007000B. An attempt was made to load a program with an incorrect format". After some searching, this is something to do with me running 32-bit application (aspnet_regiis) with IIS which is a 64-bit app. Step one has worked, as the flag has been set in the IIS GUI.
Would really appreciate it if someone could tell me where I'm going wrong, and why this doesn't work for 2008 R2.
Thanks
I know its a late post, but what I ended up having to do was run aspnet_regiis on the Framework64 folder and selecting the "Enable 32-bit Applications" on the application pool I was using and my sites came up.
In Vista and higher OS's ASP.NET is part of the OS and needs to be installed. You can install ASP.NET from the add windows features under Web Server.
The v4.0 version should work fine from both 32 and 64 bit folders.
Check for your Windows version.
If its a Windows 32 bit try running 'aspnet_regiis -i' from
C:\Windows\Microsoft.Net\Framework\v2.0.52707 folder
Or If its a 64 bit run it from
C:\Windows\Microsoft.Net\Framework64\v2.0.52707 folder
I have one sharepoint application is running.
Now, I want to run this application in 32bit mode for some backward compatibility
I have Window Server2008 with IIS 7 with MOSS 2007 running.
I have changed application pool advance setting and enabled Enable 32-bit Applications
After enabling this SharePoint Site working previously stop working and Saying Internal Server Error - 500
I have seen the Eventviewer and nothing there.
If I revert back to Enable 32-bit Applications to false then all working ok.
Can anyone tell me what's happning here?
You must install the 32bit version of MOSS if you need to run MOSS in 32bit mode on a 64bit platform.
To determine of the current installation is 32 or 64bit, take a look in which Program Files folder it's installed into.
64bit -> \Program Files
32bit -> \Program Files (x86)