手动运行Xna Content管道时检测到PInvokeStackImbalance

时间:2012-09-17 21:35:58

标签: c# xna

所以我运行这段代码

    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签名的调用约定和参数是否与目标非托管签名匹配。

StackTrace StackTrace

我尝试过的事情:

  1. 打开
  2. 上的不安全代码
  3. 添加大量日志记录(如果您想知道,则会找到dll)
  4. 不同的wav和Mp3文件(以防万一)
  5. 同步构建
  6. 更新:不只有一个错误,而是一些指向不同方法的类似错误 会更新...... 更新2:此问题可能与我用于构建内容项目的目标有关。

0 个答案:

没有答案