使用MSBuild在Jenkins中构建.net应用程序 [英] build .net application in Jenkins using MSBuild

查看:2861
本文介绍了使用MSBuild在Jenkins中构建.net应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于.net framework 3.5的.net应用程序,我试图在Jenkins CI服务器上构建这个应用程序。我添加了MSBuild插件,并添加了MSBuild 2.0,3.5和4.0版本的.exe文件的路径。但是我的构建过程失败,显示以下错误消息。

 路径到MSBuild.exe:msbuild.exe 
执行命令:cmd.exe / C msbuild.exe Neo。 sln&& exit %% ERRORLEVEL %%
[测试项目] $ cmd.exe / C msbuild.exe Neo.sln&&退出%% ERRORLEVEL %%
'msbuild.exe'不能识别为内部或外部命令,
可操作的程序或批处理文件。
构建步骤使用MSBuild构建Visual Studio项目或解决方案将uild标记为失败
完成:FAILURE

任何人都可以帮助我。

解决方案为了使MSBuild插件工作,您需要在Jenkins管理屏幕中配置插件。



注意:在较新的Jenkins版本中,您可以在全局工具配置中找到MSBuild配置





注意名称字段,我在其中调用此特定配置v4.0.30319。你可以调用它任何你喜欢的,但理想情况下,该名称将以某种方式引用版本。



你需要引用这个名称后来在Jenkins PROJECT失败。



注意:黄色警告表示MSBuild路径字段应填充目录名称,而不是文件名。在实践中,您确实需要在这里输入文件名(即msbuild.exe),否则构建步骤将失败。



在Jenkins项目失败的情况下,转到MSBuild构建步骤。



构建步骤中的第一个字段是MSBuild Version。如果在配置任何MSBuild版本之前创建了构建步骤,则此处的值将为(默认)。





配置一个或多个MSBuild版本后,下拉菜单将填充可用的配置。



您可以在这里看到我已经选择了与上述安装相符的命名配置。




I have a .net application built on .net framework 3.5, I am trying to build this application on Jenkins CI server. I've added MSBuild plugin and and have added path to the .exe file of 2.0, 3.5 and 4.0 versions of MSBuild. But my building processes are failing by showing the below error message.

Path To MSBuild.exe: msbuild.exe  
Executing command: cmd.exe /C msbuild.exe Neo.sln && exit %%ERRORLEVEL%%  
[Test project] $ cmd.exe /C msbuild.exe Neo.sln && exit %%ERRORLEVEL%%  
'msbuild.exe' is not recognized as an internal or external command,  
operable program or batch file.  
Build step 'Build a Visual Studio project or solution using MSBuild.' marked uild as failure  
Finished: FAILURE  

Could anyone plz help me out..??

解决方案

To make the MSBuild plugin work, you need to configure the plugin in the Jenkins management screen.

NOTE: in the newer Jenkins versions you find the MSBuild configuration in the Global Tool Configuration

Note the "Name" field, where I've called this particular configuration v4.0.30319. You could call it anything you like, but ideally the name will somehow refer to the version.

You'll need to refer to this name later in the Jenkins PROJECT that's failing.

Note: The yellow warning implies that the Path to MSBuild field should be populated with a directory name rather than a file name. In practice you do need to enter the filename here too (ie. msbuild.exe) or the build step will fail.

In the Jenkins project that's failing, go to the MSBuild build step.

The first field in the build step is "MSBuild Version". If you created the build step before configuring any MSBuild versions, the value here will be (default).

After configuring one or more MSBuild versions, the drop down will be populated with the available configurations. Select the one you require.

You can see here that I've now selected the named configuration that matches the installation above.

这篇关于使用MSBuild在Jenkins中构建.net应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆