简体   繁体   English

CAnnot从VS2017构建和部署旧项目

[英]CAnnot build and deploy old project from VS2017

I am working on an old project in VS2017. 我正在VS2017中处理一个旧项目。 My changes work fine in the development environment. 我的更改在开发环境中工作正常。 But when I try to build to a server I get this error; 但是,当我尝试构建服务器时,会出现此错误;

 Models\HoldingCompany.cs (21): Unexpected character '$'

The line affected is; 受影响的行是;

public override string ToString()
{
    return $"{this.Name} - {this.VatRegistrationNumber}";
}

Now it is true that the project was not originally written in C# 6. So what do I need to do to fix this? 现在确实是该项目最初不是用C#6编写的。那么我需要做些什么来解决此问题? I have install the .Net framework 4.6 on the server I am deploying to. 我已经在要部署到的服务器上安装了.Net Framework 4.6。 I have googled around trying to find what else I need to do but I have not come up with anything. 我四处搜寻试图找到我还需要做的事情,但是我什么也没想出来。 I am using the original XAML Build definitions. 我正在使用原始的XAML Build定义。 This is my log file: https://1drv.ms/t/s!ArKf9AZKW_zWgQVzxitLQzMWjfSh 这是我的日志文件: https : //1drv.ms/t/s!ArKf9AZKW_zWgQVzxitLQzMWjfSh

You need the build server to use the correct build tools. 您需要构建服务器才能使用正确的构建工具。 in your case, you need C# 6 compiler to kick in, so I recommend doing the following steps: 1. Install VS2015 build tools (or above) 2. open your build definition (xaml template) and modify the ToolPath property to point at the correct folder in your server machine: 在您的情况下,您需要C#6编译器才能启动,因此我建议执行以下步骤:1.安装VS2015构建工具(或更高版本)2.打开构建定义(xaml模板)并修改ToolPath属性以指向服务器计算机中的正确文件夹:

"C:\\Program Files (x86)\\MSBuild\\14.0\\Bin" (if VS2015) "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\MSBuild\\15.0\\Bin" (if VS2017) “ C:\\ Program文件(x86)\\ MSBuild \\ 14.0 \\ Bin”(如果是VS2015)“ C:\\ Program文件(x86)\\ Microsoft Visual Studio \\ 2017 \\ Enterprise \\ MSBuild \\ 15.0 \\ Bin”(如果是VS2017)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM