Home Dashboard Directory Help
Search

BadImageFormatException on simple program using generics and lambdas by kosak


Status: 

Closed
 as Fixed Help for as Fixed


6
0
Sign in
to vote
Type: Bug
ID: 626550
Opened: 12/1/2010 5:10:38 PM
Access Restriction: Public
0
Workaround(s)
view
4
User(s) can reproduce this bug

Description

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();
     pv.Func();
    }
}
}
Details
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(http://support.microsoft.com)
Sign in to post a workaround.