run net core using cmd publish .net code example
Example: msbuild publish to folder command line .net
msbuild mysln.sln /p:DeployOnBuild=true /p:PublishProfile=<profile-name>
msbuild mysln.sln /p:DeployOnBuild=true /p:PublishProfile=<profile-name>