VS2010 removes reference to Nplot, then errors:
1. the namespace name Nplot could not be found
2. The referenced assembly 'Nplot' could not be resolved because it has a dependency on 'System.Design
Version 4.0.0.0, ... ' which is not in the current targeted framework .NETFramework 4.0, ...
To reproduce this
1. start a new (c#) project
2. Add a Plotsurface to the toolbox (not really necessary)
3. add reference to NPlot in solution explorer (right-click, browse for Nplot dll)
4. add 'using NPlot;' at top of code
5. start typing some npolt code (say after InitializeComponent();): PlotSurface2D ps2d = new PlotSurface2D();
6. Note that intellisense knows about the Nplot items
7. Compile code and get error.
8.Look at code - PlotSurface2D ps2d = new PlotSurface2D(); is now an error.
Further
double click Nplot in Solution Explorer to display Object Browser. Nplot is missing.
Remove Nplot from references and add again. Nplot appears in Object Browser.
Compile program and Hey Presto! Nplot is gone.
Should there be a different nplot.dll for VS2010?
How do I target VS2010 for a different .NET framework?
Regards and thanks
John Allwork
Update on this.
You can retarget VS to .NET 3.5, (right-click Properties > Open, and retarget framework) and it complies, but doesn't display anything on the plotsurface
John
NPlot was compiled against .Net 2.0 in order to use .Net 2.0
components in .Net 4.0 applications you need to add an entry to the
applications config file.
Here is a link to what you need to do:
http://stackoverflow.com/questions/1604663/what-does-uselegacyv2runtimeactivationpolicy-do-in-the-net-4-config
Thanks for your reply. It does seem to work if you retarget your C# application for .NET framework 4, rather than the default .NET Framework 4 Client Profile
(Solution Explorer . right-clcik properties > Open, then change Target framework)
Solved - thanks again
John
This is because the .NET 4.0 Client install removed System.Web, upon which NPlot is dependent. You could look at the source to see if NPlot could be refactored to have a client-only dll, but I'd stick with the full framework for now.