Namespace prefix "oxy" not defined

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

morty77 wrote at 2013-09-25 12:42:

Hi there,

This might be a very basic question, but after installing OxyPlot.WPF (and OxyPlot.Core) in NuGet in a new VS 2012 project I can't see any oxyplot controls in the Toolbox. Neither can I add any XAML like in the WPF Example:
<oxy:Plot Model="{Binding MyPlotModel}"/>
Here the compiler complains about the namespace prefix "oxy" not being defined. Have I missed out something?

I would guess I would have to add a line similar to this in the Windows tag?
xmlns:oxy="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Wpf"
However, when I do that, I get the error:
FileNotFoundException: Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The system cannot find the file specified.

The C# codebehind works fine.

Thanks.

loic_lopes wrote at 2013-09-25 14:29:

Have you tried to add a reference to System.Core?

morty77 wrote at 2013-09-26 09:34:

loic_lopes wrote:
Have you tried to add a reference to System.Core?
Hi there,
A reference to System.Core is already there. I tried to search for a System.Core.dll with version 2 but could not find it on my computer. I found 3.5 but I am not sure whether I should delete the existing reference and add this one.

By the way I am targeting .NET Framework 4.5 in my project, and I'm using Visual Studio 2012 Express for Windows Desktop.

objo wrote at 2013-09-26 10:00:

The core library is a Portable Class Library (PCL).
Is your VS 2012 Express up to date? Update 3 is needed for other versions of Visual Studio 2012.

morty77 wrote at 2013-09-26 10:19:

Hello,
Yes, it's got update 3. Full version number is 11.0.60610.01. Update 3.
I have VS 2010 also running on my computer. I might try to compile it there as well.

morty77 wrote at 2013-09-26 10:38:

Ok it's building and running without any errors in VS 2010 Professional. Although I have to check my code a bit as nothing is appearing in the Window when it is running. ;) Can't notice any OxyPlot specific controls in the Toolbox, but I'm not sure if there is supposed to be anything there?

VS 2012 Express still gets the error above.

morty77 wrote at 2013-09-26 10:51:

For some reason it is actually running now in VS 2012 Express! I used NuGet to update both the OxyPlot core and OxyPlot.Wpf to the most recent versions: 2013.1.88.1 (OxyPlot core was 2013.1.84.1). Don't know if it was that that fixed it. The XAML designer still gives the the same error message though, but at least it's running. Will modify the code to try to create a plot and see how it goes...