2

I'm attempting to run a WPF application using the SharpGL library. According to the docs described on the GitHub page it should be as easy as PM> Install-Package SharpGL.WPF, but when attempting to create an OpenGLControl in xaml like this

<Window x:Class="MapRendering.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:sharpGl="clr-namespace:SharpGL.WPF;assembly=SharpGL.WPF"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <DockPanel>
            <sharpGl:OpenGLControl/>
        </DockPanel>
    </Grid>
</Window>

I get the following assembly reference error

Could not load file or assembly 'SharpGL.SceneGraph, Version=2.4.1.1, Culture=neutral, PublicKeyToken=27fc851303210b27' or one of its dependencies.

Now I can pull the SharpGL.SceneGraph source from GitHub, build and add the dll by manually browsing. But why is SharpGL.SceneGraph dll not distributed with SharpGL.WPF? Am I missing something?

James B
  • 8,975
  • 13
  • 45
  • 83

1 Answers1

0

I got the same error when I tried to upgrade my SharpGL NuGet packages from 2.4.0.0 to 2.4.1.1. From your comment I realized what was missing. Thanks. (I suppose the editor just forgot the .dll and I expect a fix to follow).

If you want to stay with a complete package from NuGet, you can just downgrade to 2.4.0. If the old version is not visibly available in your NuGet repo, it should still be there. To downgrade manually to hidden packages, just manually edit the packages.config file in your project and change the versions to "2.4.0.0". Then click on Manage NuGet packages for the project. Visual Studio will ask you if you want to restore missing NuGet's which you should accept. You still may need to switch references to the older version in Add References dialog with the Browse option.