Change csproj value through TeamCity

3

Hello everyone.

I'm using TeamCity for .NET applications. I have set up some projects, and the build-steps basically consist of building the application with Visual Studio (.sln) runner and running unit tests with NUnit , and that's all triggered through Build Triggers that looks for the changes sent to GitHub.

I was hoping that during the build process, the value of the MvcBuildViews property was changed to true , so you can include the screens in the build.

<MvcBuildViews>false</MvcBuildViews>

I found some useful articles, but had a prerequisite for using MSBuild. Is it possible to do this in some simpler way?

    
asked by anonymous 18.03.2014 / 19:51

1 answer

2

An alternative is to create a Pre-BuildEvent that triggers a program that will open the file "csproj" and then give a replace on the desired line.

This application (can be done in C # itself, Console Application) can receive in one of the parameters the name of the configuration being built (ie Debug or Release ) so that the replacement is only done in Release mode %.

Pre-BuildEvent Example:

ReplaceConsoleApp.exe "$(ConfigurationName)" "$(SolutionPath)"
    
18.03.2014 / 19:58