he name "OpenGLControl" does not exist in the namespace "clr-namespace:SharpGL.WPF;assembly=SharpGL.WPF"

1.5k views Asked by At

I have problem with openGL wrapper - SharpGL-> I am not able to build solution because of missing assembly .

The name "OpenGLControl" does not exist in the namespace "clr-namespace:SharpGL.WPF;assembly=SharpGL.WPF"

The requiered assemblies are all referenced, also in object browser I can see whole content I am using .NET 4.5.2 and VS2013

<Window x:Class="sharpGLTEst.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:my="clr-namespace:SharpGL.WPF;assembly=SharpGL.WPF"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <sharpGL:OpenGLControl />
    </Grid>
</Window>
2

There are 2 answers

0
marekfranko On

the solution is to create control directly in code

SharpGL.WPF.OpenGLControl op = new SharpGL.WPF.OpenGLControl();

public MainWindow()
        {
            InitializeComponent();
            SharpGL.WPF.OpenGLControl op = new SharpGL.WPF.OpenGLControl();
            SharpGL.OpenGL gl = op.OpenGL;
            SharpGLControlPanel.Children.Add(op);
        }
0
Alex On

It is an old question, but since I ran into it recently I thought maybe others hit this too.

To fix this I changed the project Target .NetFramework to 4.0 instead of leaving the default value, which for a new project is typically the latest version.

Good luck!