D3DERR_INVALIDCALL 错误,TeamCity 生成器

发布于 2024-07-25 07:22:00 字数 1920 浏览 1 评论 0原文

我一直在尝试使用 TeamCity 4.5 来自动构建 XNA 项目,但我遇到了一个小问题。 我的项目在 Visual Studio 2008 下可以正确编译,但在使用 TeamCity 作为构建器进行编译时则无法正确编译。 配置文件使用 sln2008 设置,并且编译在一段时间内进展顺利,但是一旦将 .png 纹理编译为 .xnb,我就会收到以下错误:

[11:28:41]: [Project "Content.contentproj" (default targets):] Content\head.png Building content threw InvalidOperationException: D3DERR_INVALIDCALL
at Microsoft.Xna.Framework.Content.Pipeline.CommonHelperFunctions.InitD3D()
at Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.InitD3D()
at Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.Import(String filename, ContentImporterContext context)
at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1.Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import(String filename, ContentImporterContext context)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAssetDirectly(BuildItem item, String importerName)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAssetWorker(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.RunTheBuild()
at Microsoft.Xna.Framework.Content.Pipeline.Tasks.BuildContent.RemoteProxy.RunTheBuild(BuildCoordinatorSettings settings, TimestampCache timestampCache, ITaskItem[] sourceAssets, String[]& outputContent, String[]& rebuiltContent, String[]& intermediates, Dictionary`2& dependencyTimestamps, KeyValuePair`2[]& warnings)
Inner exception: COMException: Exception from HRESULT: 0x8876086C

我不知道是什么原因造成的。 正如我所说,它能够正确编译 .fbx 模型以及我的 ContentPipeline 项目和 SharedContent 项目(解决方案的一部分)。

我实际上想要的是一些指向问题根源的指示(如果可能的话,问题的解决方案)。 据我了解,D3D库似乎有问题。 我还要提醒您,整个解决方案是在 Visual Studio 2008 下编译的,因此 TeamCity 存在一个小问题,要么我没有提供某些内容,要么实际上设置不正确。

I've been trying to use TeamCity 4.5 in order to automate builds of an XNA project but I have a small problem. My projects compile correctly under Visual Studio 2008, but not when compiled with TeamCity as the builder. The configuration file uses the sln2008 setting, and compiling goes well for a while, but as soon as it goes compiling .png textures to .xnb, I get the following error:

[11:28:41]: [Project "Content.contentproj" (default targets):] Content\head.png Building content threw InvalidOperationException: D3DERR_INVALIDCALL
at Microsoft.Xna.Framework.Content.Pipeline.CommonHelperFunctions.InitD3D()
at Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.InitD3D()
at Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.Import(String filename, ContentImporterContext context)
at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1.Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import(String filename, ContentImporterContext context)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAssetDirectly(BuildItem item, String importerName)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAssetWorker(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.RunTheBuild()
at Microsoft.Xna.Framework.Content.Pipeline.Tasks.BuildContent.RemoteProxy.RunTheBuild(BuildCoordinatorSettings settings, TimestampCache timestampCache, ITaskItem[] sourceAssets, String[]& outputContent, String[]& rebuiltContent, String[]& intermediates, Dictionary`2& dependencyTimestamps, KeyValuePair`2[]& warnings)
Inner exception: COMException: Exception from HRESULT: 0x8876086C

I do not have any ideas what is causing this. Like I said, it's able to compile .fbx models correctly as well as my ContentPipeline project and my SharedContent project (part of the solution).

What I would actually like is some pointers to what would be the source of the problem (and if possible, a solution to the problem). As far as I understand, there seems to be a problem with the D3D library. I will also remind you that this whole solution compiles under Visual Studio 2008, thus there is a small problem with TeamCity, either I haven't provided something, or something is actually incorrectly set.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

画尸师 2024-08-01 07:22:01

我没有解决办法,但我一直在思考。

错误是 D3DERR_INVALIDCALL,因此我认为该设备由于某种原因当时不可用。

1) 运行构建的机器是否安装了 DirectX/显卡? 我假设是的,因为 XNA 需要带有着色器的卡,但 TeamCity 是一个构建发行版,所以它可能在没有它的机器上运行?

2) 也许 TeamCity 导致在同一台机器/进程上创建太多 Direct3D 设备(完全猜测)?

正确编译的模型文件是否使用纹理或者它们只是几何数据? 我有一种感觉,内容构建器不需要访问 DirectX 来构建模型,但需要访问纹理数据。 您可以构建任何其他需要访问 Direct3D 的东西吗? 您可以使用 TeamCity 构建一个内容文件夹中只有一个纹理的项目吗?

我不确定这是否有效,但您能否通过在调试模式下运行 DirectX 并查看输出来获取更多信息?

希望这会有所帮助。

I don't have a solution but I've been thinking about it.

The error is D3DERR_INVALIDCALL so I'm thinking the device isn't available at that time for some reason.

1) Do the machines running the build have DirectX installed/a graphics card? I'm assuming yes since XNA requires a card with shaders but TeamCity is a build distribution so maybe it's running on a machine without it?

2) Maybe TeamCity is causing too too many Direct3D devices to be created on the same machine/process (complete guess)?

Do the model files that compile correctly use textures or are they just geometry data? I have a feeling the content builder doesn't need access to DirectX to build models but does for texture data. Can you build anything else that requires access Direct3D? Can you build a project using TeamCity that just has one texture in it's content folder?

I'm not sure if this would work but can you get more information by running DirectX in Debug Mode and looking at the output?

Hope this helps somewhat.

香橙ぽ 2024-08-01 07:22:01

XNA 和 DirectX 9 需要当前登录的用户才能编译内容文件夹。

解决方案很简单,使用 XNA 的先决条件(VS2008、XNA Game Studio 3.0 等)设置构建代理机器(真实的物理机器)并使其在启动时登录,然后创建一个脚本来运行团队服务器登录时代理(通过在开始菜单的启动文件夹中放置代理运行脚本的快捷方式)。

这样,代理将以本地用户身份运行并可以正常构建。

我已经做到了这一点并且可以确认它有效。

XNA and DirectX 9 require a current logged in user in order to compile the Content folder.

The solution is simple, set up a build agent machine (real physical machine) with the pre-reqs for XNA (VS2008, XNA Game Studio 3.0, etc) and make it log in on startup, then create a script to run the team server agent when logged in (by placing a shortcut to the agent run script in the start up folder in the start menu).

This way the agent will run as the local user and can build as normal.

I have done this and can confirm that it works.

清醇 2024-08-01 07:22:01

抱歉拖了一个旧线程,但我刚刚遇到了完全相同的问题,试图让 TC 在 Windows Server 上构建我的 XNA 项目,并希望帮助其他人遇到同样的问题。

我刚刚发现这篇文章和博客看起来是一个非常有前途的解决方案:
http://forums.create.msdn.com/forums/p/86699 /532976.aspx

&

http://blogs.msdn.com/b/astebner /archive/2011/07/07/10184338.aspx

Aaron 基本上指出,Win Phone SDK 7.1 Beta 2 的新测试版包含 XNA Game Studio 4.0 Refresh Beta 2,现在允许您通过内容管道构建内容以下类型的配置:

如果您的屏幕在构建期间被锁定
如果您在无头计算机上运行构建
如果您从非交互式用户帐户运行构建

,但看起来它只能在 Vista 或更高版本上运行 - 希望这也应该包括服务器。 更新:不,遗憾的是它不会安装在我的 Windows 服务器上:(

Sorry to drag up an old thread but I've just run into the exact same problem trying to get TC to build my XNA project on Windows Server and wanted to help others coming across the same problem.

I've just found this article and blog which looks like a very promising solution:
http://forums.create.msdn.com/forums/p/86699/532976.aspx

&

http://blogs.msdn.com/b/astebner/archive/2011/07/07/10184338.aspx

Aaron basically states that the new beta of Win Phone SDK 7.1 Beta 2 contains XNA Game Studio 4.0 Refresh Beta 2 which now allows you to build content via the content pipeline in the following types of configurations:

If your screen is locked during a build
If you are running a build on a headless computer
If you are running a build from a non-interactive user account

But it looks like it'll only run on Vista or above - hopefully that should include servers too. Update: Nope sadly it wont install on my Windows Server :(

羞稚 2024-08-01 07:22:00

几乎可以肯定,Team City 正在以非交互模式作为本地系统运行其构建过程,而不是作为实际有权访问和获取图形设备的用户。 我知道我什至在尝试通过远程桌面界面批量处理纹理时都遇到了问题,因为 DirectX 无法获取图形设备。

解决方案可能是看看 Team City 是否为您提供了请求其构建器作为登录用户运行的能力,而不是作为本地系统或作为服务运行,尽管我不能告诉您这在 Team City 中实际上是可能的。

Almost certainly, Team City is running it's build process as Local System in a non-interactive mode, and not as a user that actually has the access and ability to grab the graphics device. I know I've had problems even attempting to batch process textures through a Remote Desktop interface because DirectX can't grab the graphics device.

The solution may be to see if Team City offers you the ability to request that it's builder run as a logged on user, not as Local System, or as a service, though I can't tell you that that's actually even possible in Team City.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文