Tag Archives: msbuild

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.

MSBuild command line ignoring publish properties: solution

MSBuild 2017 command line seems to ignore your publish profile? You are trying to run a command similar to this and your projects/artifacts are not copied where they are supposed t be copied?

msbuild /p:Configuration=Release /p:DeployProjects=true /p:PublishProfile=Release

I have msbuild in my PATH, which is here just in case:

C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\amd64\msbuild.exe

Maybe you are using a build server, with Jenkins or a similar tool and you did not install Visual Studio 2017. I have such a setup and I installed just the ms build tools standalone package, find it at the bottom of this page: Build Visual Studio Downloads > find Build Tools for Visual Studio 2017.

This seems to be a well known issue, on github somebody reported the problem, and many people joined with a comment “Same to me”.

Solution

In my case, I noticed I forgot to select also Web development build tools > .NET Framework 4.6.2 development tools:

Updating ms build tools and adding this missing component did the job. Now when I run msbuild I get my artifacts as expected.

If this solution helped you, consider buying something at my favorite affiliate website. I consider this better than asking a donation, because like this you get a product you may need and use and I just get a little commission, which doesn’t affect the price, so win to win 😉