SharpDX - Choose build actions

278 views Asked by At

working with SharpDX. Now I want to use the ContentManager and load some resources, so I have to set the build Actions of the specific files (either ToolkitTexture or ToolkitFont). The Problem is, that I cant choose between these two actions.

I found this "Workaround" http://sharpdx.org/forum/5-api-usage/2504-toolkit-spritefont-spritefont-compiler-and-build-action and I added manually the NuGet - .packages-Folder of SharpDX, but this does not make the Options visible. What I'm missing?

Kind regards, Erik

1

There are 1 answers

0
Shounbourgh On

So...found a solution:

Following has to be added at the end of the *.csproj-File, that all SharpDX - Build Actions are available

<Import Project="..\..\SharpDX\packages\SharpDX.2.6.2\build\SharpDX.targets" Condition="Exists('..\..\SharpDX\packages\SharpDX.2.6.2\build\SharpDX.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
  <PropertyGroup>
    <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
  </PropertyGroup>
  <Error Condition="!Exists('..\..\SharpDX\packages\SharpDX.2.6.2\build\SharpDX.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\SharpDX\packages\SharpDX.2.6.2\build\SharpDX.targets'))" />
  <Error Condition="!Exists('..\..\SharpDX\packages\SharpDX.Toolkit.2.6.2\build\SharpDX.Toolkit.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\SharpDX\packages\SharpDX.Toolkit.2.6.2\build\SharpDX.Toolkit.targets'))" />
</Target>
<Import Project="..\..\SharpDX\packages\SharpDX.Toolkit.2.6.2\build\SharpDX.Toolkit.targets" Condition="Exists('..\..\SharpDX\packages\SharpDX.Toolkit.2.6.2\build\SharpDX.Toolkit.targets')"/>

So just the first line is not enough (but probably the error blocks are mandatory, but safety first ;) )

Kind regards, Erik