锐化DX - 选择构建操作

本文关键字:构建 操作 选择 DX 锐化 | 更新日期: 2023-09-27 18:30:24

使用SharpDX。现在我想使用ContentManager并加载一些资源,所以我必须设置特定文件(ToolkitTexture或ToolkitFont)的构建操作。问题是,我无法在这两个动作之间做出选择。

我找到了这个"解决方法"http://sharpdx.org/forum/5-api-usage/2504-toolkit-spritefont-spritefont-compiler-and-build-action,我手动添加了 SharpDX 的 NuGet - .packages-文件夹,但这不会使选项可见。我错过了什么?

亲切的问候,埃里克

锐化DX - 选择构建操作

所以...找到解决方案:

必须在 *.csproj-文件的末尾添加以下内容,说明所有 SharpDX - 构建操作都可用

<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')"/>

所以只有第一行是不够的(但可能是错误块是强制性的,但安全第一;))

亲切的问候,埃里克