0

C#: Class Member variable called ‘type’ causes weird compile issues caused by AVAST Antivirus.

Problem:

Try and use this class in any C# project and it won’t work, it will give errors after compiling that it can’t copy the exe/dll with the following errors codes (warning MSB3026: and error MSB3027: and error MSB3021:)

public class cDescriptions
        {
            public string appid { get; set; }
            public string classid { get; set; }
            public string instanceid { get; set; }
            public string icon_url { get; set; }
            public string icon_url_large { get; set; }
            public string icon_drag_url { get; set; }
            public string name { get; set; }
            public string market_hash_name { get; set; }
            public string market_name { get; set; }
            public string name_color { get; set; }
            public string background_color { get; set; }
            public string type { get; set; }
            public int tradable { get; set; }
            public int marketable { get; set; }
            public int commodity { get; set; }
            public string market_fee_app { get; set; }
            public string market_tradable_restriction { get; set; }
            public string market_marketable_restriction { get; set; }
        }

Renaming the ‘type’ member variable to anything else causes it to compile and run perfectly.

I tested this on my vs 2012 and 2013 and it failed, I can declare this class on vs 2015.

Link to StackOverflow where I raised this question.

The fix & the cause:

Upon disabling AVAST Antivirus, it worked perfectly! Avast was interfering silently without telling me and causing me these weird issues.