Free style Jenkins build issue for net core application

Using below command
MSBUILD. Exe /target:restore /target:build %workspace©

Only restore alone happening
Target build not executing
But build success

I need restore and build in same command

are you using a shell command, or some sort of msbuild plugin? if its a shell step you should have full control over what you run. If its a msbuild plugin, sadly thats the issue with freestyle and those plugins, the lack of fine grain control, you’ll have to wait for people with more experience using it.

Based on MSBuild Command-Line Reference - MSBuild | Microsoft Docs I assume that the -target argument (or /target) is only allowed once in a command line. The last one “wins”.

The docs says that you can run multiple targets with -target:first;second;third . Pass a semicolon separated list to the -target argument.


I have tried the below command

MsBuild. exe /target:“restore;Build” %workspace%\doc\doc.sln /p:OutDir= %workspace%\doc\webdeploy\Release /P:skipInvaildconfiguration=true /p:Deployonbuild=true /p:deploytype=package /P:Generatesampledeployscript=true /P:DeployIISpath= doc

The below arguments not executed.

p:Deployonbuild=true /p:deploytype=package /P:Generatesampledeployscript=true

Does that command work from a Windows command prompt?

If not, then you may need to consult with people who understand the details of msbuild.exe interaction with the windows command prompt.

If it does work from the command prompt but fails in Jenkins, then you may need to check that workspace has a sensible value in your Jenkins job

i’m a little concerned by the space between = and the value. On linux = means your providing the value as the same argument, without the = you do it as the next argument.


I have checked and tried
Still facing the same error