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.
when i check in my code, the build server throws an error
, seems you are using a CI build. You could also give a try with manually queue the build. And build your code in local to narrow down if it's related to your TFS environment or not.
Also take a look at event view in the build agent/server, if there are some useful info.
Error BC30037: Character is not valid
without TFxxxx may related to your code or syntax.
- Check to see if an extra character has accidentally been inserted into the programming element.
- Check that the programming element is spelled or constructed using only characters that are valid for that kind of element
Character is not valid
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With