5

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 Answers 2

6

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.

Sign up to request clarification or add additional context in comments.

3 Comments

I have added the parameters and ran the publish step successfully once, but I am now unable to "re-publish" I build the solution in an msbuild step before this and then run msbuild on the web application project only in the solution as a second step, so my jenkins job is performing two msbuild steps with the "publishing" of the vbproj as the last step. I have tried endless to determine why it published one and now will not re-publish. Here are the parameters: /p:VisualStudioVersion=12.0 /p:DeployOnBuild=true /p:PublishProfile=local.pubxml. Any help would be greatly appreciated
Also, when I run the following from the command line: msbuild StarWebPortal.vbproj /p:DeployOnBuild=true /p:PublishProfile=local.pubxml It appears that all I get is the build output, but from the one run I had that seemed to publish I can see a target getting called: CopyAllFilesToSingleFolderForPackage: Creating directory "obj\Debug\Package\PackageTmp". Copying all files to temporary location below for package/publish: obj\Debug\Package\PackageTmp.
Folks: The msbuild.exe parameters listed above are good and work. The issue I ran into was that the .vbproj files was modified while testing and a key section was commented out.
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.