tfs 构建服务器 - 字符串插值 $ 字符无效 [英] tfs build server - string interpolation $ Character is not valid

查看:20
本文介绍了tfs 构建服务器 - 字符串插值 $ 字符无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的代码中使用 $ 使用字符串插值.它编译得很好,但是当我检入我的代码时,构建服务器抛出一个错误 BC30037: Character is not valid.以下是我如何使用字符串插值的示例:

dim r = New RadNode($"{acq.FormNo} - ${CInt(acq.TotalAmount)}", icon:=RadTreeIcons.RedTriangle)

构建服务器已安装 Visual Studio 2015 企业版.

如果我从命令提示符运行:

C:\Program Files (x86)\MSBuild\14.0\Bin>MSBuild/tv:14.0 "Proj.sln",代码编译文件.但是,如果我将上述参数更改为

C:\Program Files (x86)\MSBuild\14.0\Bin>MSBuild/tv:12.0 "Proj.sln",我得到同样的错误

我也做了这些更改:

我已将 MSBuildArguments 属性设置为 /p:VisualStudioVersion=14.0 并且还更改了 TFSBuild.proj 文件并将此行更改为<Project DefaultTargets="DesktopBuild" xmlns="schemas.microsoft.com/developer/msbuild/2003";ToolsVersion="14.0">" 但同样的问题也发生了.

更改了 (web vbproj) 文件并将工具集版本从 12.0 更改为 14.0.解决方案的其他 vb 项目部分仍以 12.0 为目标,但作为 web vb 项目的一部分在 dll 中编译.

解决方案

位于此处的答案解决了我的问题:

转到团队资源管理器下的主页选项卡,然后单击源代码管理资源管理器

找到模板文件,双击编辑.它应该出现在这样的图形视图中.滚动直到找到 Run MSBuild for Project

点击此项目将立即显示属性

单击右侧的小图标 - 不要尝试输入它,因为它可能会爆炸并使 Visual Studio 崩溃.在引号中输入以下C:\Program Files (x86)\MSBuild\14.0\bin"

现在是最重要的部分

对我来说,Run MSBuild for Project 有两个地方.

所以我只是在两个地方重复了上述步骤,然后在我签入 .xaml 文件后,我的构建最终运行良好.

您可能需要从 TFS 工具中回收代理/控制器.

i am using string interpolation using $ in my code. It compiles fine but when i check in my code, the build server throws an error BC30037: Character is not valid. Following is an example on how i have used string interpolation:

dim r = New RadNode($"{acq.FormNo} -  ${CInt(acq.TotalAmount)}", icon:=RadTreeIcons.RedTriangle)

The build server has Visual Studio 2015 Entreprise edition installed.

If i run this from command prompt:

C:\Program Files (x86)\MSBuild\14.0\Bin>MSBuild /tv:14.0 "Proj.sln", the code compiles file. However if i change the above argument to

C:\Program Files (x86)\MSBuild\14.0\Bin>MSBuild /tv:12.0 "Proj.sln", i get the same error

I have also made these changes:

i have set the MSBuildArguments Property to /p:VisualStudioVersion=14.0 and also changed the TFSBuild.proj file and changed this line to <Project DefaultTargets="DesktopBuild" xmlns="schemas.microsoft.com/developer/msbuild/2003"; ToolsVersion="14.0">" but same issue is happening.

Changed the (web vbproj) file and changed ToolSet Version to 14.0 from 12.0. Other vb projects part of the solution are still targeting 12.0 but gets compiled in dll as part of web vb project.

解决方案

Answer located here solved my problem:

BuildActivity ignores ToolsVersion

For those of us not living inside build templates every day here's the steps that got it working for me:

First find the template associated with your build (if you already know where to find it skip a couple steps).

Just right click the build definition and select Edit build definition Select the Process tab and you'll see the name of the template (quite likely to be DefaultTemplate if you haven't customized it). On the far right click Show details to see the path for the template.

Go to the Home tab under Team explorer and click Source control explorer

Find the template file and double click to edit it. It should come up in a graphical view like this. Scroll till you find Run MSBuild for Project

Click on this item which will immediately bring up properties

Click on the little icon on the right - don't try and type it in because it'll probably explode and crash Visual Studio. Enter IN QUOTES the following "C:\Program Files (x86)\MSBuild\14.0\bin"

NOW FOR THE MOST IMPORTANT PART

For me the Run MSBuild for Project was in TWO places.

So I just repeated the above steps in both places, and then after I checked in the .xaml file my build FINALLY worked fine.

You may need to recycle the agent / controller from within the TFS tool.

这篇关于tfs 构建服务器 - 字符串插值 $ 字符无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆