.net - BadImageFormatException on startup with Application Framework enabled -
i've got .net app have been developing many years (about 15 projects, of pretty large) , have encountered following exception when trying launch it.
system.badimageformatexception unhandled message: not load file or assembly 'system.runtime.remoting, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089' or 1 of dependencies. attempt made load program incorrect format.
there doesn't appear call stack - happens before launching code, can't step in. using dll in projects, have gone through , removed references it, still getting error. happening project (i can launch other projects within solution ok , other projects other solutions ok).
edit
after lot of fiddling around, disabling application framework in application tab under project seems allow launch, can't work out why. want re-enable make use of of features.
edit 2 after lot more messing about, think caused application framework using remoting enforce single instance application. however, .net reflector seems indicate shouldn't run if uncheck single instance option still have problem if do. said, still go scope of method uses types assembly (microsoft.visualbasic.applicationservices.applicationbase.run), presume causing try resolve assembly. whilst interesting, doesn't give answer why i'm getting exception. i've tried reproducing empty project , works fine - both set on same application framework settings, both on .net 4.0, both x86. i'm pretty stumped go here.
it can typically occur when changed target framework of .csproj , reverted started with.
make sure 1 if supportedruntime version="a different runtime cs project target" under startup tag in app.config.
make sure 2 means checking other autogenerated or other files in may properties folder see if there no more runtime mismatch between these files , 1 defined in .csproj file.
these might save lot of time before start trying different things project properties overcome error.
Comments
Post a Comment