Asked by:
BadImageFormatException

Question
-
I have a ClickOnce app that has been successfully installed and upgraded over the last 4 months on 50 machines. Today one machine gives the following error:
ERROR DETAILS
Following errors were detected during this operation.
* [5/13/2009 10:08:56 AM] System.BadImageFormatException
- The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.NativeMethods.IAssemblyCache.QueryAssemblyInfo(Int32 flags, String assemblyName, AssemblyInfoInternal& assemblyInfo)
at System.Deployment.Application.Win32InterOp.SystemUtils.QueryAssemblyInfo(QueryAssemblyInfoFlags flags, String assemblyName)
at System.Deployment.Application.PlatformDetector.VerifyGACDependencyWhidbey(ReferenceIdentity refId)
at System.Deployment.Application.PlatformDetector.VerifyGACDependency(ReferenceIdentity refId, String tempDir)
at System.Deployment.Application.PlatformDetector.VerifyPlatformDependencies(AssemblyManifest appManifest, Uri deploySupportUri, String tempDir)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
The app can still be installed on all other machines and so I don't think there is actually a corrupt file.
This is VS 2008 and on the machine with the problem it doesn't matter what user profile is attempting to do the install. The application runs fine if it is copied directly to the machine. Logging on as an admin and deleting the Apps folder also does not help.
Any help would be appreciated. ThanksWednesday, May 13, 2009 2:33 PM
All replies
-
What version of Windows are you running, and what versino of .Net are you targeting? RobinDotNet
Click here to visit my ClickOnce blog!Wednesday, May 13, 2009 10:45 PM -
In .NET the usual reason for BadImageFormatException is when a 1.1 assembly attempts to reference a 2.0 assembly.
Phil WilsonThursday, May 14, 2009 8:15 PM -
Hi Dan,
I do a search and find a blog article discussing the BadImageFormatException:
"BadImageFormatException maybe thrown when loading a valid assembly"
http://blogs.msdn.com/junfeng/archive/2007/07/11/badimageformatexception-maybe-thrown-when-loading-a-valid-assembly.aspx
Hope this helps.
Sincerely,
Linda Liu
Please remember to mark the replies as answers if they help and unmark them if they provide no help. end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.Tuesday, May 19, 2009 9:34 AM