5

I am fairly new to using TeamCity. We are currently using 9.16.

I am trying to setup a build template to associate across our many projects and I keep getting the error "Failed to find Visual Studio .sln file" for both the NuGet Installer step and Visual Studio (.sln).

Currently it is set to %system.teamcity.build.checkoutDir% and it says there is no *.sln file there, but there is when I look at the build server directly.

Failed to find Visual Studio .sln file at C:\TeamCity\buildAgent\work\58ef95107452dcbc\*.sln

I found the post regarding attaching the VCS root, but I do have that attached and it mirrors the projects that currently do not use a template.

Any help as to what I am missing would be greatly appreciated.

Chase Swanson
  • 127
  • 1
  • 9

3 Answers3

3

You must put the filename of your visual studio solution file in the "Solution file path" field of the "Visual Studio (.sln)" build runner step.
If your .sln file is at the root of your checkout directory you would specify the filename. Example: YourSolution.sln

For the "Nuget Installer" build runner step you must put the same solution filename in the "Path to Solution File" field.

Note that if your solution file is not in the root folder of your checkout folder you must specify the relative path. Example: path/to/my/SolutionFile.sln

Jeremy F
  • 417
  • 2
  • 16
  • Thank you. I was trying to grab it dynamically by referencing *.sln, but I have found that is not possible. I have switch to placing a parameter in the template and changing the parameter value in each project. – Chase Swanson Sep 02 '16 at 05:12
0

What I was attempting to do is not possible.

Instead I created a parameter at the root level for SolutionFile in the templates. Then I simply change the value of that parameter in each project that uses the template.

Chase Swanson
  • 127
  • 1
  • 9
  • Can you please explain with an example? I am facing same issue for many days. I do clean checkout from SVN to temporarily fix this issue. Thanks. – Ganesh Jadhav Mar 28 '20 at 06:04
0

In my case I was moving from SVN to GIT with TeamCity, and so had to change the VCS root from:

http://build.server.url:81/svn/MyApp/

To,

http://Build-Server-User@git.build.server.url:7990/MyApp/MyApp.git

Also, I had to change "checkout rules" from:

+:trunk => .

To,

+: => .

Because the default branch in TeamCity for GIT is refs/heads/master

For details, please see https://confluence.jetbrains.com/display/TCD10/Git

user8128167
  • 6,929
  • 6
  • 66
  • 79