Tag Archives: jenkins

msbuild: CSC : error CS1617: Invalid option ‘7.3’ for /langversion; must be ISO-1, ISO-2, Default, Latest or a valid version in range 1 to 7.1.

If you are running msbuild.exe via command line and get this error:

CSC : error CS1617: Invalid option '7.3' for /langversion; must be ISO-1, ISO-2, Default, Latest or a valid version in range 1 to 7.1.

e.g. from also from a build agent such as jenkins, the solution may be as easy as to upgrade Microsoft Build Tools 2015.

You can do that via choco install microsoft-build-tools or manually via the official Microsoft Build Tools 2015 or by updating your Visual Studio 2017 installation.

If you found this post useful, consider buying something fun/useful for yourself or a gift for a friend using my banggood referral link and I’ll get a little commission (you still get the same -best- price). Thank you.

Jenkins: checkout Gerrit patchset (Gerrit Trigger plugin)

Today I had to setup automatic pipeline triggering for each new patchset pushed to Gerrit for review. The Gerrit Trigger plugin makes it a piece of cake to achieve the goal.

In reply to How to Checkout a Gerrit Change in a Jenkins Sandbox Pipeline: such a snippet can be easily found directly in Jenkins > browse to your pipeline > click “configure” > click “pipeline syntax” > Sample step: select checkout: General SCM > fill what you need, click on advanced and add a refspec and generate the snippet. Here a snippet using the GERRIT variables exposed by the plugin.

node {
 stage('checkout gerrit patchset') {
 echo "gerrit branch: ${GERRIT_BRANCH}, gerrit refspec: ${GERRIT_REFSPEC}"
 checkout([$class: 'GitSCM', branches: [[name: "${GERRIT_BRANCH}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'jenkins-rsa', refspec: "${GERRIT_REFSPEC}", url: 'ssh://yourgerritserver:29418/yourrepo']]])
 }
}

Note extensions: [[$class: ‘CleanBeforeCheckout’]] is a good idea if you need to build from different branches, if your setup is simpler, you can just use extensions: [].