New error after buying commercial version
#1
We developed some code for DXEngine and Powertoys using the AB4D evaluation license and then purchased the commercial version. We've switched the references in Visual Studio over to the new, commercial DLLs and I've confirmed that we're looking at the correct ones in the properties of those references in Visual Studio.

But now when I do a build I get an error:

Unknown build error, 'Cannot resolve dependency to assembly 'SharpDX.DXGI, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event. Line 16 Position 92.' C:\Users\PeterN\Documents\Visual Studio 2013\Projects\Partition_Tool2\Source\Partition1\MainWindow.xaml 16 92

The code indicated in the XAML file is:
Code:
<dxControls:DXViewportView Name="MainViewportView" PresentationType="DirectXImage">
            <Viewport3D Name="MainViewport" ClipToBounds="true" Margin="230,70,20,170" >
            </Viewport3D>
        </dxControls:DXViewportView>

This all built fine with the evaluation version of the AB4D code.

What am I doing wrong?

(thanks in advance)
#2
I have never seen such error before.

Have you added reference to SharpDX.dll, SharpDX.DXGI.dll, SharpDX.Direct3D11.dll and SharpDX.Mathematics.dll to your project? (Note that the SharpDX.Mathematics.dll is only needed when using SharpDX v3.1 and is not needed for v2.6.3)

Is your project's target framework set to .Net 4.5 or newer? The SharpDX v3.1 can be only used on .Net 4.5+. If the target framework is 4.0, then you need to use SharpDX 2.6.3.
Andrej Benedik
#3
(01-18-2017, 10:05 PM)abenedik Wrote: I have never seen such error before.

Have you added reference to SharpDX.dll, SharpDX.DXGI.dll, SharpDX.Direct3D11.dll and SharpDX.Mathematics.dll to your project? (Note that the SharpDX.Mathematics.dll is only needed when using SharpDX v3.1 and is not needed for v2.6.3)

Is your project's target framework set to .Net 4.5 or newer? The SharpDX v3.1 can be only used on .Net 4.5+. If the target framework is 4.0, then you need to use SharpDX 2.6.3.

It is .Net 4.5. I have fixed the problem by explicitly adding the references to the SharpDX libraries as you suggested but I don't understand it. I didn't have those in the project when I was using the evaluation version of the AB4D library and I haven't changed a single line of code in my source code.

I have added an attachment of a pair of screenshots of the Visual Studio Solution Explorer "References" section for the project when it was using the evaluation version versus the commercial version to prove that the SharpDX libraries were not explicitly included. The one on the left was when I was using the evaluation version - it built and ran fine. The one on the right is the current version, showing the SharpDX references needed to get a good build. Anyway, everything seems good now.


Attached Files Thumbnail(s)
   
#4
I am glad that adding references fixed the problems.

Adding the references is also described in the "DXEngine Quick start" guide that is available in the "Ab3d.DXEngine Help.chm" help file (installed into the same folder as Ab3d.DXEngine).


The reason for the differences between evaluation and commercial version is that the previous version of DXEngine installed SharpDX dlls into GAC, but the latest version of DXEngine do not do that any more.

When SharpDX dlls were in GAC, the compiler could get them when compiling your project.

The reason to not install SharpDX into GAC was that that there are two different versions of SharpDX with the same assembly version 2.6.3.0 - one for DirectX 11 and one for DirectX 11.1.

The core assemblies (Ab3d.DXEngine.dll and Ab3d.DXEngine.Wpf.dll) are still installed into GAC. In some cases this can make using the libraries easier.

But sometimes this can lead to some problems that are not very easy to resolved (also because of some unclear compiler errors). For example when the SpecificVersion is set to false (by default), the compiler can take the version from GAC instead of the version that you have explicitly specified with selecting the dll file.

Therefore I am thinking of removing the GAC installation from installers or at least uncheck GAC install by default.

One of the reasons why the assemblies were installed into GAC was also to make the sample project compile without user needed to fix the references. But this is not needed any more because a new CustomAction in the installer now updates the csproj fles and sets the correct paths to the references.
Andrej Benedik
  


Forum Jump:


Users browsing this thread:
1 Guest(s)