问题标签 [xbuild]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
msbuild - 如何让 XamarinStudio 将目标文件生成到单独的目录中?
让我们以这个为例。我正在 linux 上进行开发,并将 XamarinStudio 用于我的所有 .NET 项目。比起在虚拟机中运行 VisualStudio,我更喜欢它。我有一个包含多个项目的解决方案,如下所示:
我可以为所有项目设置输出目录,但我不知道如何设置项目以生成临时文件到 Temp 文件夹。现在临时文件生成到 /Solution/ProjectX/obj/x86/Debug/ 和 /Solution/ProjectX/obj/x86/Debug/ 中。我怎样才能改变它?我找不到在项目/解决方案属性中设置它的方法。
asp.net - using Microsoft.VisualStudio.Web.targets from Mono?
In an attempt to use the TransformWebConfig
and Package
tasks from Microsoft.VisualStudio.Web.Publishing.targets in a Mono-based CI build, I took a dependency on the MSBuild.Microsoft.VisualStudio.Web.target
NuGet package and updated my project file to Import it. The build works fine with MSBuild, but xbuild is unable to process the targets file:
Unable to parse condition "'$(EnableWebPublishProfileFile)'=='true' And '$(WebPublishProfileFile)' != '' And Exists($(WebPublishProfileFile))" : Expected a property at position 90 in condition "'$(EnableWebPublishProfileFile)'=='true' And '$(WebPublishProfileFile)' != '' And Exists($(WebPublishProfileFile))". Missing opening parantheses after the '$'.
Actually, this is the error when I explicitly try to import Microsoft.Web.Publishing.targets
; it is normally imported transitively by importing Microsoft.WebApplication.targets
. I think xbuild is failing (silently) to load the former when I just import the latter, as I simply get the error:
error : Target named 'TransformWebConfig' not found in the project.
Again, this build works fine with MSBuild. The project file has the following Import directive:
<Import Project="$(SolutionDir)\packages\MSBuild.Microsoft.VisualStudio.Web.targets\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets" />
c# - 重命名 app.config
我有两个项目,它们在同一位置使用相同的代码,但使用不同的依赖项和 app.config 文件,并且两个项目都编译为相同的 exe 名称。
目前,我配置了一个 PreBuild 脚本,该脚本将正确的project_a.config
文件project_b.config
从app.config
.
不幸的是,XBuild 在从命令行运行时不会执行 PreBuild 脚本,所以我必须在构建之前进行复制。
有没有办法使用另一个文件作为 app.config?
编辑: 请注意,这仅在 Linux 上运行。
我的 csproj 文件中的条目:
这是我的构建脚本:
mono - xbuild - 编译的应用程序在哪里?
我刚刚开始使用 xbuild 来使用 Visual Stuido 的 .sln 文件编译我的 C# 解决方案。结果是两个文件夹: bin 和 obj 与项目的 .cs 文件放置在相同的本地化中。
它们都包含 Debug 和 Release 版本的文件夹,当我运行它们时,这两个版本似乎是同一个应用程序。
bin和obj中的那些应用程序之间有什么区别吗?如果有,哪一个是我“应该”运行的“完整应用程序”?还是我错过了一些标志/选项?应用程序运行需要哪些文件(如果我只想移动可执行文件并想运行它们,哪些文件是必需的?)
如果有必要,我正在使用 OSX (10.10.2)、XBuild 12.0 和 Mono 3.10.0.0。提前致谢。
asp.net - TravisCI - Asp.net 部署到 Linux 服务器
我可以通过 TravisCI.org 构建我的 asp.net 4 (MVC) 应用程序,但我无法将 travis 的输出“复制”到我的 linux 服务器。
我想用 *.sh 文件解决这个问题,但我不知道如何启动它以及 TravisCI - Build 中的文件位于何处。
xamarin - *.sln 将在 Xamarin Studio 中构建,但不在 xbuild 中
我有一个包含 16 个 C# 项目的 Visual Studio 解决方案。我还有一个单独的build.proj
文件,其中包含三个<Target>
s:
Build
,其中包含<MSBuild>
对 *.sln 的引用Package
,其中包含<MakeDir>
和<CopyCommands>
将构建的 DLL/EXE 文件与各种数据文件一起复制到一个$(StagePath)
目录。Deploy
,将文件从阶段路径复制到部署路径。
我能够运行命令xbuild /t:Deploy build.proj
来构建 *.sln 并将其文件复制到适当的位置,直到最近 IT 决定将我的 Documents 文件夹移动到网络驱动器上。
现在,每当我尝试运行这个 xbuild 命令时,我都会收到几个错误,如下所示。(引用是同一解决方案中的依赖项之一。)
但是,每当我在 Xamarin Studio 的同一个 *.sln 上执行“全部构建”时,我都会成功构建,出现 0 个错误和 0 个警告。那么,如果 Xamarin Studio 可以,为什么 xbuild 找不到这些程序集引用呢?
mono - 如何使用 Mono 的 xbuild.exe 在命令链接中设置 `OutDir`?
我正在尝试使用与 msbuild 相同的构建命令在 msysgit (Windows) 中构建 ac# 解决方案:
"C:/Windows/Microsoft.NET/Framework/v4.0.30319/msbuild.exe" /p:Configuration=Debug /p:OutDir="c:\projects\proudly\build" "src/Proudly.Identity.sln"
使用 msbuild,构建的输出进入我的/build
文件夹,一切都很好。现在,当我使用 Mono 的 xbuild 运行相同的命令时,如下所示:
"C:/Program Files (x86)/Mono/lib/mono/xbuild/12.0/bin/xbuild.exe" /p:Configuration=Debug /p:OutDir="c:\projects\proudly\build" "src/Proudly.Identity.sln"
...并且我的构建输出进入/bin/Debug
每个项目的文件夹而不是我的构建文件夹。
我的印象是 xbuild 可以像 msbuild 一样使用。任何线索我做错了什么?
msbuild - 如何将项目文件中的变量传递给“MSBuild”任务
我们正在使用一个项目文件,然后调用 MSBuild 任务。例如,
在项目文件中,我现在定义了一个要传递给 MSBuild 任务的变量。
c# - Is there xbuild /t:Package support? (TravisCI)
(somewhat related issue)
TravisCI supports C# builds and Elastic Beanstalk deployments. Cool. But I can't get the Package target to build my zip file that gets deployed into EBS IIS.
My .travis.yml file looks like:
mono version:
The (OK) build message is:
The (FAIL) /t:Package message looks like:
So my question is, why Target named 'Package' not found in the project
? I've verified /t:Package
works fine with MSBuild on a Windows machine.
Note: I've found that if I add an empty target into the .csproj file like
It no longer complains about a missing target, but does nothing:
Any xbuild help would be greatly appreciated.
linux - CentOS 6 .sln xbuild compilation error (SteamBot)
I recently just started using linux and I'm not very familiar with some of the errors or commands.
I keep getting the following error and really can't understand why
"/home/steambotv1.0/SteamBot-master/.nuget/../.ci/exec-with-retry.sh: No such file or directory"
Why is it looking for that file? it never did on windows (it compiles fine on windows)
Can any please point me in the right direction?
Here is the rest of the error message:
XBuild Engine Version 3.0.0.0 Mono, Version 3.0.0.0 Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2011.
Build started 8/5/2015 12:00:36 AM.
Project "/home/steambotv1.0/SteamBot-master/SteamBot.sln" (default target(s)): Target ValidateSolutionConfiguration: Building solution configuration "Debug|Any CPU". Target Build: Project "/home/steambotv1.0/SteamBot-master/SteamTrade/SteamTrade.csproj" (default target(s)): Target RestorePackages: Executing: bash "/home/steambotv1.0/SteamBot-master/.nuget/../.ci/exec-with-retry.sh" mono --runtime=v4.0.30319 /home/steambotv1.0/SteamBot-master/.nuget/NuGet.exe install "packages.config" -source "" -RequireConsent -solutionDir "/home/steambotv1.0/SteamBot-master/" bash: /home/steambotv1.0/SteamBot-master/.nuget/../.ci/exec-with-retry.sh: No such file or directory /home/steambotv1.0/SteamBot-master/.nuget/NuGet.targets: error : Command 'bash "/home/steambotv1.0/SteamBot-master/.nuget/../.ci/exec-with-retry.sh" mono --runtime=v4.0.30319 /home/steambotv1.0/SteamBot-master/.nuget/NuGet.exe install "packages.config" -source "" -RequireConsent -solutionDir "/home/steambotv1.0/SteamBot-master/"' exited with code: 127. Task "Exec" execution -- FAILED Done building target "RestorePackages" in project "/home/steambotv1.0/SteamBot-master/SteamTrade/SteamTrade.csproj".-- FAILED Done building project "/home/steambotv1.0/SteamBot-master/SteamTrade/SteamTrade.csproj".-- FAILED Task "MSBuild" execution -- FAILED Done building target "Build" in project "/home/steambotv1.0/SteamBot-master/SteamBot.sln".-- FAILED Done building project "/home/steambotv1.0/SteamBot-master/SteamBot.sln".-- FAILED
Build FAILED. Errors:
/home/steambotv1.0/SteamBot-master/SteamBot.sln (default targets) -> (Build target) -> /home/steambotv1.0/SteamBot-master/SteamTrade/SteamTrade.csproj (default targets) -> /home/steambotv1.0/SteamBot-master/.nuget/NuGet.targets (RestorePackages target) ->
/home/steambotv1.0/SteamBot-master/.nuget/NuGet.targets: error : Command 'bash "/home/steambotv1.0/SteamBot-master/.nuget/../.ci/exec-with-retry.sh" mono --runtime=v4.0.30319 /home/steambotv1.0/SteamBot-master/.nuget/NuGet.exe install "packages.config" -source "" -RequireConsent -solutionDir "/home/steambotv1.0/SteamBot-master/"' exited with code: 127.