所以我运行这段代码
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
我尝试过的事情:
更新:不只有一个错误,而是一些指向不同方法的类似错误 会更新...... 更新2:此问题可能与我用于构建内容项目的目标有关。