【发布时间】:2016-03-12 21:51:39
【问题描述】:
我有以下代码用于在solutionPath 构建解决方案:
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 功能,否则我会出错。例如:
throw new ArgumentException($"Could not find any registered events with the name {name}.");
给我以下内容:
错误意外字符'$'
我是否需要更改 BuildManager 或参数上的某些设置?我正在构建的应用程序以 .NET 4.6 为目标,由 Visual Studio 2015 构建。
【问题讨论】: