如何在 OS X 和 Linux 上安装 MSBuild?

How to install MSBuild on OS X and Linux?(如何在 OS X 和 Linux 上安装 MSBuild?)
本文介绍了如何在 OS X 和 Linux 上安装 MSBuild?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我希望在我的 Linux 笔记本电脑上安装 MSBuild,以便构建我的 C# OSS 项目.我该怎么做呢?我遇到了一些指南,例如 this 建议安装 MSBuild NuGet 包,但它似乎不是官方的或积极维护的.

I'm looking to install MSBuild on my Linux laptop so I can build a C# OSS project of mine. How exactly would I go about doing this? I've come across a few guides such as this which suggest installing the MSBuild NuGet package, but it doesn't seem official or actively maintained.

是否有可以安装 MSBuild 的官方包源?

Is there an official package source I can install MSBuild from?

推荐答案

有,CoreFX 团队 作为 MyGet 提要.要安装,请在终端上运行:

Yes, there is such a package hosted by the CoreFX team as a MyGet feed. To install, run this at a terminal:

#!/bin/sh

packageid="Microsoft.Build.Mono.Debug"
version="14.1.0.0-prerelease" # update as needed

mono path/to/nuget.exe install $packageid -Version 
    $version -Source "https://www.myget.org/F/dotnet-buildtools/"

# run MSBuild
mono $packageid.$version/lib/MSBuild.exe Foo.sln

从技术上讲,这应该仅用于构建 .NET Core 存储库,但我会将其作为非官方发布者的替代方案.

Technically this should be used only for building the .NET Core repos, but I'll take it as an alternative to an unofficial publisher.

来源.

请注意,这仅适用于您的 Mono 版本为 4.0.1 或更高版本.

Note that this will only work if your version of Mono is 4.0.1 or above.

这篇关于如何在 OS X 和 Linux 上安装 MSBuild?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

MSBuild cannot find a reference(MSBuild 找不到参考)
The reference assemblies for framework .NETCore, Version=v5.0 were not found(未找到框架 .NETCore,Version=v5.0 的参考程序集)
quot;File has a different computed hash than specified in manifestquot; error when signing the EXE(“文件的计算哈希值与清单中指定的不同签署EXE时出错)
Good-practices: How to reuse .csproj and .sln files to create your MSBuild script for CI?(良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 MSBuild 脚本?)
Run an MSBuild target only if project is actually built(仅在实际构建项目时运行 MSBuild 目标)
MS-Build BeforeBuild not firing(MS-Build BeforeBuild 未触发)