1

Closed

Unit Testing Windows Phone 8 loads incorrect assembly?

description

I have a WP8 project which has the following struct:
    [JsonConverter(typeof(StringEnumConverter))]
    public enum CardType
    {
        [EnumMember(Value = "A")]
        Artist = 'A',

        [EnumMember(Value = "C")]
        Contemporary = 'C',

        [EnumMember(Value = "H")]
        Historical = 'H',

        [EnumMember(Value = "M")]
        Musician = 'M',

        [EnumMember(Value = "S")]
        Sports = 'S',

        [EnumMember(Value = "W")]
        Writer = 'W'
    }
this runs perfectly fine in the app...

However, when I attempt to deserialize a string in a TEST project, it fails saying it's loading the wrong assembly (4.0.0.0 when it should be 2.0.5.0).

I've tried every combination of references and Copy Local and am at a complete loss. I ended up just mocking the Deserialize method to force a success, but is there something else I need to do to use this attribute in a windows phone unit test project?
Closed Oct 3, 2013 at 10:01 AM by JamesNK
Sorry I don't know.

comments

SelArom wrote Sep 5, 2013 at 3:11 PM

I forgot to mention it's the EnumMember that's causing this to happen. on the WindowsPhone project it loads the correct WP8 assembly, but in my test project it's loading the standard .Net4 assembly