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.

3
  • 5
    you have to have .net 4.0 installed to even run it. Dec 6, 2013 at 12:10
  • you can't run 4.0 components in an older version of the clr. Dec 6, 2013 at 12:11
  • Can you please add this as answer so I can accept it?
    – jnovacho
    Dec 6, 2013 at 12:19

2 Answers 2

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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.