Note that there are some explanatory texts on larger screens.

plurals
  1. POBadImageFormat Exception at Microsoft.CSharp library
    primarykey
    data
    text
    <p>I'm having little problem running my C# application after switching to Windows 8.1 from 8. The problem is that I get this exception from title and there's not much help online. I tried to pinpoint the problem and it seems like my x64 application is trying to call x86 CSharp library. The reference in project leads to a DLL file, that upon calling x64 dumpbin program with /headers parameter outputs:</p> <pre><code>Dump of file Microsoft.CSharp.dll PE signature found File Type: DLL FILE HEADER VALUES 14C machine (x86) 3 number of sections 4FFA5C64 time date stamp Mon Jul 09 06:21:56 2012 0 file pointer to symbol table 0 number of symbols E0 size of optional header 2022 characteristics Executable Application can handle large (&gt;2GB) addresses DLL </code></pre> <p>Notice the machine is x86, while the application is running in x64 (checked with Environment.Is64BitProcess). This might be the problem I'm facing, however I can't find way to solve it - there seems to be no x64 .Net libraries installed. The only ones I have found are at: <code>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework</code>. Or maybe I'm completely off and there's some other problem. Anyway the exception occurs at startup in one of constructors and full detail is:</p> <pre><code>Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a "Could not load file or assembly 'Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The module was expected to contain an assembly manifest." </code></pre> <p><strong>Edit:</strong></p> <p>While still panicking, I solved this by downloading <a href="http://www.dllme.com/dll/files/microsoft_csharp_dll.html" rel="nofollow">CSharp.dll</a> and replacing the dummy 0-byte file in path shown in answer by it.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload