BadImageFormatException on simple program using generics and lambdas - by kosak

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 626550 Comments
Status Closed Workarounds
Type Bug Repros 4
Opened 12/1/2010 5:10:38 PM
Access Restriction Public


The following simple program throws a BadImageFormatException on the indicated line.

using System;

namespace TestApp1 {
  public abstract class A<T>  {
    public virtual T Func() {
      return default(T);

  public class B : A<string> {
    public override string Func() {
      Func<string> a=()=>base.Func();
      return a(); //BadImageFormatException

  public class Program {
    public static void Main(string[] args) {
      var pv=new B();
Sign in to post a comment.
Posted by Microsoft on 4/8/2011 at 4:58 PM
Thanks for reporting this issue you've encountered with Visual Studio!

We no longer see this BadImageFormatException getting thrown in our internal builds of Visual Studio, and so we're resolving this bug as Fixed. You'll see this fix in the version of Visual Studio after VS 2010.

Alex Turner
Program Manager
Visual Basic and C# Compiler
Posted by Microsoft on 12/1/2010 at 9:42 PM
Thanks for your feedback. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 12/1/2010 at 5:55 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(