[英]he name “OpenGLControl” does not exist in the namespace “clr-namespace:SharpGL.WPF;assembly=SharpGL.WPF”
I have problem with openGL wrapper - SharpGL-> I am not able to build solution because of missing assembly . 我在使用openGL包装器-SharpGL->时遇到问题,因为缺少程序集,所以无法构建解决方案。
The name "OpenGLControl" does not exist in the namespace "clr-namespace:SharpGL.WPF;assembly=SharpGL.WPF" 名称“ OpenGLControl”在命名空间“ 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 所需的程序集都被引用 ,也在对象浏览器中,我可以看到我正在使用.NET 4.5.2和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>
the solution is to create control directly in code 解决方案是直接在代码中创建控件
SharpGL.WPF.OpenGLControl op = new SharpGL.WPF.OpenGLControl(); SharpGL.WPF.OpenGLControl op =新的SharpGL.WPF.OpenGLControl();
public MainWindow()
{
InitializeComponent();
SharpGL.WPF.OpenGLControl op = new SharpGL.WPF.OpenGLControl();
SharpGL.OpenGL gl = op.OpenGL;
SharpGLControlPanel.Children.Add(op);
}
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. 为了解决这个问题,我将项目Target .NetFramework更改为4.0,而不是保留默认值,对于新项目,默认值通常是最新版本。
Good luck! 祝好运!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.