Skip to content

Problem with BadImageFormatException when instantiating generic class referencing ObservableCollection #10

Open
@jho1965us

Description

@jho1965us

The following code will reproduce the problem
Using CNeptune version 1.2.1

namespace NConcernConstructorFail
{
    class Program
    {
        static void Main(string[] args)
        {
            var a = new A(); // OK
            var b = new B<int>(); // System.BadImageFormatException: 'An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)'
        }
    }
    class A
    {
        ObservableCollection<int> o = new ObservableCollection<int>();
    }
    class B<T>
    {
        ObservableCollection<T> o = new ObservableCollection<T>();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions