1

In my current program I'm using some features of .NET 4.0 - specifically the Charting API ( System.Windows.Forms.DataVisualization.Charting). I will ship the application, but I'm not sure the client has the .NET 4.0 installed.

Is it possible to add some hooks/event handlers to disable this feature in my program as it's not vital for it's function?

My idea is that when user clicks on Show Chart button, message will be shown - "Please install NET 4.0+". I would prefer not to ship 2 versions of my program.

jnovacho
  • 2,825
  • 6
  • 27
  • 44

2 Answers2

4

In order to use any 4.0 assembly, you have to have at least .net 4.0 installed, have a process hosted in at least a 4.0 CLR.

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
1

You could get the installed .NET Versions of the User and then disabled your feature. I think this would be the easiest way.

EDIT: See comments, he's right. Nevertheless if you need to get the versions use this.

Community
  • 1
  • 1
DJmRek
  • 378
  • 6
  • 13