3
votes

I have a .vbproj which is a VB.NET web application project. I can build the solution that contains this project and then right click on the project and publish locally. No issues from with VS 2013 professional update 3.

I am trying to build this solution and then publish the project outside of VS using the msbuild plugin from within Jenkins CI.

The project does not get published as it says it is skipping unpublishable project.

The command and it output is as follows:

Executing the command

 cmd.exe /C C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
 /t:Publish /p:VisualStudioVersion=12.0 /p:OutDir=C:/temp/eric
 StarWebPortal/StarWebPortal/StarWebPortal.vbproj && exit
 %%ERRORLEVEL%% from C:\Tools\Jenkins\jobs\STAR-dev_POC\workspace

[workspace] $ cmd.exe /C C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe /t:Publish /p:VisualStudioVersion=12.0 /p:OutDir=C:/temp/eric StarWebPortal/StarWebPortal/StarWebPortal.vbproj && exit %%ERRORLEVEL%% Microsoft (R) Build Engine version 4.0.30319.18408 [Microsoft .NET Framework, version 4.0.30319.18444] Copyright (C) Microsoft Corporation. All rights reserved.

Build started 8/22/2014 11:46:51 AM. The target "MvcBuildViews" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets (840,131)" does not exist in the project, and will be ignored. Project "C:\Tools\Jenkins\jobs\STAR-dev_POC\workspace\StarWebPortal\StarWebPortal\StarWebPortal.vbproj" on node 1 (Publish target(s)). _DeploymentUnpublishable: Skipping unpublishable project. Done Building Project "C:\Tools\Jenkins\jobs\STAR-dev_POC\workspace\StarWebPortal\StarWebPortal\StarWebPortal.vbproj" (Publish target(s)).

Any idea why it works from within VS and not from the msbuild command line?

2

2 Answers

6
votes

You have to configure Jenkins to pass two additional arguments to MsBuild.exe which are /p:DeployOnBuild=true and /p:PublishProfile=your_publish_profile.pubxml.

The command should be like msbuild your_vb_project.vbproj /p:DeployOnBuild=true /p:PublishProfile=publish_profile.pubxml You don't need to specified path to publish_profile.pubxml as long as it's under the same directory with your vbproj.

0
votes

As of Visual Studio 2013, MSBuild is now a separate component from the .NET Framework and is included in the install with VS. It is also available as a separate download for build servers. It looks like you are using the "old" v4.0 MSBuild path. You need to use the new MSBuild path which is something like C:\Program Files(x86)\MSBuild\12.0\bin. You need to configure the Jenkins MSBuild plugin to use this path.