JMK JMK - 1 month ago 8x Question

Could not load System.Drawing V4.0.0.0 on a VB.Net Windows form in Visual Studio 2010

I've decided to learn Visual Basic .Net as this is what some of my colleagues work with, and this will allow me to work with them on projects.

I have purchased Microsoft Visual Basic 2010 Step by Step and downloaded the sample files. When I am trying to debug the first sample application (a Windows form), it is telling me that it can't load System.Drawing V4.0.0.0. However, if I create a new Windows Form application (C# or VB.Net) this works fine.

I had a look at the References tab in the project settings and System.Windows.Forms is referenced, but the version referenced is I have removed and re-added this reference and it stays at and I still get the error.

Does anybody have any ideas as to what may be going on?

I am using Visual Studio 2010 Professional.



This is because of a discrepancy in the target framework. v4.0.0.0 is targeting .NET framework v4.0 - v2.0.0.0 is targeting .NET framework v2.0. You can change the framework target for your project in

Project -> 
   (myProject) Properties... -> 
      Compile -> 
         Advanced Compile Options -> 
            Target Framework...