Tag: msbuild 4.0

无论VS 2015中的版本(通配符)如何,都删除MSBuild DLL引用

在C#项目中,我有一个DLL引用,我想在构建之前将其删除(将被另一个替换 – 这是一个尝试在开发中轻松覆盖NuGet DLL的解决方案(VS 2015) )。 以下目标似乎有效: False ..\..\..\Build\My.dll 这个问题是我需要指定要删除的DLL的确切版本,这可能会改变。 无论版本如何,我都想删除它。 我试过一个通配符 …但是这似乎没有任何匹配,因为我得到了error CS1704: An assembly with the same simple name ‘My’ has already been imported.

使用MSBuild 4.0记录构建消息

我在代码中使用MsBuild 4.0,如下所示: var globalProperties = new Dictionary(); var buildRequest = new BuildRequestData(solutionPathAbsolute, globalProperties, null, new string[] { “Build” }, null); var pc = new ProjectCollection(); var result = BuildManager.DefaultBuildManager.Build(new BuildParameters(pc), buildRequest); 请注意这个API与MsBuild 3.5的完全不同…如何在记录器中挂钩以使用新API接收详细的构建消息?

MSBuild内联任务 – 引用非标准Microsoft程序集

我正在使用新的MSBuild内联任务来利用Microsoft.Web.Publishing.Tasks.dll程序集中的TransformXml(XDT转换)。 这是我的任务(剪切)看起来像: … 这个编译很好并且加载了DLL,但是,执行时它失败了,因为它试图在appbase路径中找到程序集: C:\Windows\Microsoft.NET\Framework\v4.0.30319 。 我原以为它会看到我给它的路径。 Fusion日志显示: === 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: […]