Msbuild unpublishable project

I have a .vbproj which is a VB.NET web application project. I can build a solution that contains this project and then right click on the project and publish it locally. No problem 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 Jenkins CI.

The project is not published as it says it is skipping a non-public project.

The command and its output looks like this:

Command execution

 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 / CC: \ 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 on 08/22/2011 11:46:51 AM. The "MvcBuildViews" object specified in the BeforeTargets attribute in the "C: \ Program Files" (X86) \ MSBuild \ Microsoft \ VisualStudio \ v12.0 \ Web \ Microsoft.Web.Publishing.targets (840,131) "does not exist in the project and will ignored. " C: \ Tools \ Jenkins \ works \ STAR-dev_POC \ workstation \ StarWebPortal \ StarWebPortal \ StarWebPortal.vbproj "at node 1 (Publish target (s)). _DeploymentUnpublishable: skip non-public project. Finished construction project" C: \ Tools \ Jenkins \ jobs \ STAR-dev_POC \ workstation \ StarWebPortal \ StarWebPortal \ StarWebPortal.vbproj "(Publish Target (s)).

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

+3


source to share


2 answers


You need 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 do not need to specify the path to publish_profile.pubxml

if it is in the same directory with yours vbproj

.

+6


source


As of Visual Studio 2013, MSBuild is now a separate component of the .NET Framework and is included in the installation 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, something like C:\Program Files(x86)\MSBuild\12.0\bin

. You need to configure Jenkins MSBuild plugin to use this path.



0


source







All Articles