我正在使用新的MSBuild内联任务来利用Microsoft.Web.Publishing.Tasks.dll
程序集中的TransformXml(XDT变换)。MSBuild内联任务 - 参考非标准Microsoft程序集
这里就是我的任务(剪断)看起来像:,
<Task>
<Reference Include="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll"/>
<Reference Include="System.Xml" />
<Using Namespace="System"/>
<Using Namespace="System.Linq"/>
<Using Namespace="System.IO" />
<Using Namespace="System.Xml"/>
<Using Namespace="Microsoft.Web.Publishing.Tasks"/>
<Code Type="Fragment" Language="cs">...</Code>
</Task>
编译没有和DLL加载,但在执行时,因为它试图找到它是应用平台的路径装配失败:C:\Windows\Microsoft.NET\Framework\v4.0.30319
。我会期待它看到我给它的道路。
融合日志显示此:
=== Pre-bind state information ===\r
LOG: User = xxx\Kamran\r
LOG: DisplayName = Microsoft.Web.Publishing.Tasks, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)\r
LOG: Appbase = file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/\r
LOG: Initial PrivatePath = NULL\r
Calling assembly : (Unknown).\r
===\r
LOG: This bind starts in default load context.\r
LOG: Using application configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe.Config\r
error MSB4018: LOG: Using host configuration file: \r
error MSB4018: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.\r
error MSB4018: LOG: Post-policy reference: Microsoft.Web.Publishing.Tasks, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\r
error MSB4018: LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Web.Publishing.Tasks.DLL.\r
error MSB4018: LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Web.Publishing.Tasks/Microsoft.Web.Publishing.Tasks.DLL.\r
error MSB4018: LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Web.Publishing.Tasks.EXE.\r
error MSB4018: LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Web.Publishing.Tasks/Microsoft.Web.Publishing.Tasks.EXE.\r
有什么办法解决这一问题或将我不得不创建任务组件呢?
不正确关闭的错误报告:[MSBuild:用于内联任务引用的路径未被遵守](https://connect.microsoft.com/VisualStudio/feedback/details/768289/msbuild-path-used-for-直列任务引用是 - 不兑现)。重新提交:[MSBuild:用于内联任务引用的路径不受尊重(采取2)](https://connect.microsoft.com/VisualStudio/feedback/details/2285231) – Stijn 2016-01-26 11:04:16
该错误已被Microsoft转载,您可以在https://github.com/Microsoft/msbuild/issues/594上关注其进展 – Stijn 2016-04-28 08:14:12