2
votes

I have configured for other projects to publish the .Net project using Jenkins and they all worked well. I'm using this command:

"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" %WORKSPACE%\Source\test1.sln /T:Clean /T:Rebuild. 

But this didn't work for ASP.NET core project using Jenkins to build and publish. Manually, I can build and publish from Visual Studio 2017. Does anyone here know how to configure Jenkins to build and publish ASP.Net CORE project using Jenkins.

1
I don't believe .Net core uses MSBuild 14. You need to use the new CLILiam

1 Answers

3
votes

Jenkins should not be the problem here. I can confirm that my Jenkins jobs are building Net Core 2.0 solutions. You need MSBuild "15" which can be downloaded here (build tools for VS 2017). After installation, the default location should be C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe.

And yours can be changed into something like this:

"& C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe" %WORKSPACE%\Source\test1.sln /T:Clean /T:Rebuild.

Furthermore, you can check the changes here with the build tool at Github.