首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在使用BuildManager 6的项目上使用C#

如何在使用BuildManager 6的项目上使用C#
EN

Stack Overflow用户
提问于 2015-12-08 04:32:54
回答 1查看 2.7K关注 0票数 0

我有以下代码用于在solutionPath构建解决方案

代码语言:javascript
复制
var properties = new Dictionary<string, string>();
properties["Configuration"] = buildType;
properties["Platform"] = "x86";

var request = new BuildRequestData(solutionPath, properties, null, new string[] { "Build" }, null);
var result = BuildManager.DefaultBuildManager.Build(parameters, request);

它工作得很好,除非我的项目包含了C# 6.0特性,否则我会出错。例如,以下内容:

代码语言:javascript
复制
throw new ArgumentException($"Could not find any registered events with the name {name}.");

给我以下内容:

错误意外字符“$”

我是否需要更改我的BuildManager或参数的设置?我的应用程序正在做这座大楼,目标是.NET 4.6,并由Visual 2015开发。

EN

回答 1

Stack Overflow用户

发布于 2015-12-08 04:54:48

看起来我的项目引用的是相关.dlls的旧版本:

  • Microsoft.Build
  • Microsoft.Build.Engine
  • Microsoft.Build.Framework

更多信息在这里:

BuildManager to use another version of MSBuild

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34148057

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档