1

所以我正在运行这段代码

    static readonly string[] PipelineAssemblies =
        {
            "Microsoft.Xna.Framework.Content.Pipeline.FBXImporter" + XnaVersion,
            "Microsoft.Xna.Framework.Content.Pipeline.XImporter" + XnaVersion,
            "Microsoft.Xna.Framework.Content.Pipeline.TextureImporter" + XnaVersion,
            "Microsoft.Xna.Framework.Content.Pipeline.EffectImporter" + XnaVersion,
            "Microsoft.Xna.Framework.Content.Pipeline.XImporter" + XnaVersion,
            "Microsoft.Xna.Framework.Content.Pipeline.AudioImporters" + XnaVersion,
            "Microsoft.Xna.Framework.Content.Pipeline.VideoImporters" + XnaVersion,

        };

中间有更多代码.....

        // Register any custom importers or processors.
        foreach (string pipelineAssembly in PipelineAssemblies)
        {
            _buildProject.AddItem("Reference", pipelineAssembly);
        }

中间有更多代码.....

        var execute = Task.Factory.StartNew(() => submission.ExecuteAsync(null, null), cancellationTokenSource.Token);
        var endBuild = execute.ContinueWith(ant => BuildManager.DefaultBuildManager.EndBuild());

        endBuild.Wait();

基本上尝试使用代码构建内容项目......如果您删除 XImporter、AudioIMporters 和 VideoImporters,这很有效,但是我收到以下错误:

检测到 PInvokeStackImbalance 消息:对 PInvoke 函数 'Microsoft.Xna.Framework.Content.Pipeline!Microsoft.Xna.Framework.Content.Pipeline.UnsafeNativeMethods+AudioHelper::GetFormatSize' 的调用使堆栈不平衡。这可能是因为托管 PInvoke 签名与非托管目标签名不匹配。检查 PInvoke 签名的调用约定和参数是否与目标非托管签名匹配。

堆栈跟踪 堆栈跟踪

我尝试过的事情:

  1. 打开不安全代码
  2. 添加大量日志记录(找到 dll 以防您想知道)
  3. 不同的 wav 和 Mp3 文件(以防万一)
  4. 同步构建

更新:不仅有一个错误,还有一些指向不同方法的类似错误将更新... 更新 2:这个问题可能与我用来构建内容项目的目标有关。

4

0 回答 0