"Mixed mode assembly" error on pure .net assembly

2

The question is: since it is obvious that my assembly is not mixed mode, what else can cause "Mixed mode assembly" exception?

Details:

I have a pure .net executable assembly hosts wcf services. I checked that it is pure .net assembly by the method found in this post

Also I checked all referenced assemblies and for all of them was the same CorFlags output.

There is an output of ildasm and corflags

//  Microsoft (R) .NET Framework IL Disassembler.  Version 4.0.30319.17929     
...
// ----- CLR Header:                                                                                                             
// Header size:                        0x00000048                                                                                
// Major runtime version:              0x0002                                                                                    
// Minor runtime version:              0x0005                                                                                    
// 0x00002aec [0x00003128] address [size] of Metadata Directory:                                                                 
// Flags:                              0x00000009            

Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  4.0.30319.17929                                                 
Version   : v2.0.50727                                                                                                           
CLR Header: 2.5                                                                                                                  
PE        : PE32                                                                                                                 
CorFlags  : 0x9                                                                                                                  
ILONLY    : 1                                                                                                                    
32BITREQ  : 0                                                                                                                    
32BITPREF : 0                                                                                                                    
Signed    : 1    

It runs with the following app.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" />
    <supportedRuntime version="v2.0.50727" />
  </startup>
 </configuration>

On all our test configurations it runs good. But on the machine of one customer it fails with exception

System.IO.FileLoadException: Mixed mode assembly is built against version
'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without
additional configuration information.

Unfortunately this customer does not allow us remote debugging of this problem.

The question is: since it is obvious that my assembly is not mixed mode, what else can cause the same exception?

.net
mixed-mode
asked on Stack Overflow Apr 11, 2014 by Ed Pavlov • edited May 23, 2017 by Community

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0