Config which machine.config to use

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I am getting the following exception when running my WCF Service:<br/><br/>System.BadImageFormatException: Could not load file or assembly file:///C:UserscpiszDocumentsSource ControlServicesDataServiceDataTransportbinx86DebugDataTransport.dll or one of its dependencies. An attempt was made to load a program with an incorrect format.<br/>File name: file:///C:UserscpiszDocumentsSource ControlServicesDataServiceDataTransportbinx86DebugDataTransport.dll<br/> at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)<br/> at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)<br/> at System.Reflection.Assembly.Load(AssemblyName assemblyRef)<br/> at Microsoft.Tools.SvcHost.ServiceHostHelper.LoadServiceAssembly(String svcAssemblyPath)
=== Pre-bind state information ===<br/>LOG: User = CICcpisz<br/>LOG: Where-ref bind. Location = C:UserscpiszDocumentsSource ControlServicesDataServiceDataTransportbinx86DebugDataTransport.dll<br/>LOG: Appbase = <a>file:///C:/Users/cpisz/Documents/Source Control/Services/DataService/DataTransport/bin/x86/Debug<br/>LOG: Initial PrivatePath = NULL<br/>Calling assembly : (Unknown).<br/>===<br/>LOG: This bind starts in LoadFrom load context.<br/>WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().<br/>LOG: Using application configuration file: C:UserscpiszDocumentsSource ControlServicesDataServiceDataTransportbinx86DebugDataTransport.dll.config<br/>LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v2.0.50727configmachine.config.<br/>LOG: Attempting download of new URL <a>file:///C:/Users/cpisz/Documents/Source Control/Services/DataService/DataTransport/bin/x86/Debug/DataTransport.dll.<br/>ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.<br/><br/><br/>I cannot for the life of me figure out why I am getting a badformat exception. That means it is trying to load something that is x64 instead of x86 right? All my project files are configured to target x86. Ive double and triple checked. I also went through each and every reference in each and every project.<br/><br/>The only thing I can fathom is that when you look at the exception it mentions using Framework64/...machine.config<br/>I went and looked to see if there is a Framework/....machine.config and there is.<br/>Should I be using the latter? If so how do I tell my service to do that?<br/><br/><br/><br/>

View the full article
 
Back
Top