Vikram Singh
Vikram Singh

Reputation: 31

Getting error "System.Runtime.Versioning.TargetFrameworkAttribute from assembly 'mscorlib, Version=2.0.0.0'"

I am new to C#, need help in debugging an error, nothing much on internet was helpful.

I Changed Target Framework from .net 2 to .net 4 for related projects, after this I started getting this error.

The error is:

''System.Runtime.Versioning.TargetFrameworkAttribute' from assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

I found that this TargetFrameworkAttribute is not available in mscorlib 2.0.0.0 but available in mscorlib 4.0.0.0, but don't know from where it is picking mscorlib of version 2.0.0.0 .

I found the code which is causing problem, but now don't know what to look for here.

this.inCallWaitPictureBox.Image = ((System.Drawing.Image)resources.GetObject("inCallWaitPictureBox.Image")));

System.ComponentModel.ComponentResourceManager resources System.Windows.Forms.PictureBox PresetupForm.inCallWaitPictureBox

I also found that this func GetObject() is in mscorlib assembly.

plz give me some pointers to resolve this error.

Upvotes: 2

Views: 2264

Answers (1)

il Giovine
il Giovine

Reputation: 166

I solved the same problem switching "<NoStdLib>true</NoStdLib>" with "<NoStdLib>false</NoStdLib>" into my_project.csproj file

Upvotes: 1

Related Questions