我正在使用 Microsoft.Build.BuildEngine.Engine 来构建 WPF 应用程序。这已经成功地用于类库和 Web 应用程序,但现在尝试使用它来构建 WPF 应用程序我收到以下错误:
目标 MarkupCompilePass1: c:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.WinFX.targets(294,9): error MC1000: Unknown build error, 'API 限制: 程序集 'file:///C: \Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\PresentationCore.dll' 已从其他位置加载。它不能从同一 appdomain 中的新位置加载。在项目“TestWindowsApplication.csproj”中完成构建目标“MarkupCompilePass1”——失败。
此应用程序在使用 VisualStudio 2008 构建时构建良好(即从菜单构建),但使用 Microsoft.Build.BuildEngine.Engine 会引发此构建错误。有人知道这里发生了什么吗?