System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.

1,809 views
Skip to first unread message

fyz

unread,
Nov 9, 2012, 4:33:03 AM11/9/12
to gend...@googlegroups.com
Hi,
I am getting the following error during gendrame execution during sonar analysis.I am using gendarme 2.11 sanpshot version .

Command :

C:\Program Files\Gendarme>gendarme.exe --config D:\ApplicationFramework\CIT.PTP.Managers\target\sonar\sonar.Gendarme --xml D:\ApplicationFramework\CIT.PTP.Managers\target\sonar\gendarme-report.xml --quiet --confidence normal+ --severity all D:\ApplicationFramework\CIT.PTP.Managers\bin\Debug\CIT.PTP.Managers.dll


Error :

An uncaught exception occured. Please fill a bug report at https://bugzilla.nove ll.com/
Rule:   Gendarme.Rules.Design.TypesWithDisposableFieldsShouldBeDisposableRule
Target: CIT.PTP.Managers.ExcelExportManager
Stack trace: System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.
   at Mono.Cecil.PE.ImageReader.ReadImage()
   at Mono.Cecil.PE.ImageReader.ReadImageFrom(Stream stream)
   at Mono.Cecil.ModuleDefinition.ReadModule(Stream stream, ReaderParameters par
ameters)
   at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters p
arameters)
   at Mono.Cecil.BaseAssemblyResolver.SearchDirectory(AssemblyNameReference name , IEnumerable`1 directories, ReaderParameters parameters)
   at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, Reader Parameters parameters)
   at Gendarme.Framework.AssemblyResolver.Resolve(AssemblyNameReference name)
   at Mono.Cecil.MetadataResolver.Resolve(IAssemblyResolver resolver, TypeRefere nce type)
   at Mono.Cecil.TypeReference.Resolve()
   at Gendarme.Rules.Design.TypesWithDisposableFieldsShouldBeDisposableRule.Chec
kType(TypeDefinition type)
   at Gendarme.Framework.Runner.OnType(RunnerEventArgs e)
   at Gendarme.Framework.Runner.Run()
   at Gendarme.ConsoleRunner.Run()
   at Gendarme.ConsoleRunner.Execute(String[] args)


How to debug this error ?

Thanks and Regards,
Fayaz ahamed.


Eric Zeitler

unread,
Nov 9, 2012, 3:19:42 PM11/9/12
to gend...@googlegroups.com
That usually happens when the dll or exe isn't a .NET executable.  Can you confirm that actually is a .NET dll?





--
You received this message because you are subscribed to the Google Groups "Gendarme" group.
To view this discussion on the web visit https://groups.google.com/d/msg/gendarme/-/uCzmu0VnmFkJ.
To post to this group, send email to gend...@googlegroups.com.
To unsubscribe from this group, send email to gendarme+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gendarme?hl=en.

Reply all
Reply to author
Forward
0 new messages