My plugin throws error TypeLoadException: Could not load type 'System.Runtime.Versioning.TargetFrameworkAttribute' from assembly

As the title states I’m writing an Editor Plugin for something that I want to make simpler. The code runs run as a cs file so I decided to bundle it up as a dll in case I want to make it available to others and to learn a bit about dll files. I’ve made a new class library project in Visual Studio 2013 and copied my code over and compiled it.

The code still runs but prompts me with a super annoying error every time the editor refreshes the script, the exact error is.

TypeLoadException: Could not load type 'System.Runtime.Versioning.TargetFrameworkAttribute' from assembly 'MyPlugin'.
System.MonoCustomAttrs.GetCustomAttributesBase (ICustomAttributeProvider obj, System.Type attributeType) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/MonoCustomAttrs.cs:108)
System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/MonoCustomAttrs.cs:151)
System.MonoType.GetCustomAttributes (System.Type attributeType, Boolean inherit) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/MonoType.cs:595)
UnityEngine.AttributeHelperEngine.CheckIsEditorScript (System.Type klass) (at C:/buildslave/unity/build/Runtime/Export/AttributeHelperEngine.cs:107)

I’ve checked the attributes for the project and it says that it is targeting .NET 4, I’ve tried both debug and release versions of the DLL and get the same issue, is there a step I am missing here or is there something else I can try to fix this?

Visual Studio, when creating new projects, adds a few Assembly references. Since Unity runs on a Mono subset, these references may not carry over well. So, what you need to do, is go to the References section of the Solution Explorer in VS, and remove all of them that you don’t need to compile your project. That way, when Unity tries to import it, it won’t be asking for all those other assemblies that Unity does not use/support.

Solved? I have the same problem, but still not working