是否可以使用 .NET 版本进行构建而无需“安装”?那个版本?

发布于 2024-08-13 17:46:48 字数 708 浏览 2 评论 0原文

我希望在我的存储库中将 .NET 的不同版本作为标记或子模块,就像其他外部产品 nunit、ninject、rhinomocks 一样。 ProjectX 是使用 .NET 3.0 和 nunit 2.4.x 创建的 Projecty 是使用 .NET 3.5 和 nunit 2.5.x 创建的 项目 Z 是使用 .NET 4.0B2 和 nunit 的预生产版本创建的,

我希望这样做是为了能够从一台计算机进行更改,而无需对该计算机进行更改,例如将其更新到最新版本的 .NET,如果事实并非如此。 例如,如果我想在仍为 2.0 的计算机上更改 3.0、3.5 甚至 4.0B2 项目(也许它不是我的,也没有管理员权限)。我想检查该项目,它需要的 .net 版本(以及存储库中的其他版本库 nunit、ninject、rhinomocks 等)使用 Notepad2 或其他非 Visual Studio 编辑器进行更改(因为 VS 需要安装为以及安装的框架),运行构建脚本并提交/推送更改。完成后,删除签出/克隆的目录和文件,就好像我从未在那台计算机上一样。

背景: 我的存储库由许多较小的不相关的项目组成,而不是像一个巨大的网络应用程序/网站那样。 为什么要维护外部库的版本?因为我并不总是想一次更新所有项目。如果我这样做的话,就会有一个脚本。 每个开发人员都是远程办公顾问。谁知道他们的机器上有什么?谁关心一切(除了 .NET 框架)都是通过构建脚本指向的。 也许我的机器坏了,我需要使用我的祖母。也许我正在度假,有人的密码坏了(显然不是我的),我需要使用酒店。

I would like to have in my repository as tagged or submodules the different versions of .NET like is possible with other external products nunit, ninject, rhinomocks.
ProjectX is created with .NET 3.0 and nunit 2.4.x
Projecty is created with .NET 3.5 and nunit 2.5.x
Project Z is created with .NET 4.0B2 and a preproduction release of nunit

I would like to do this to be able to make changes from a machine without haveing to make changes to that machine, like updateing it to the latest version of .NET if it isn't.
If I want to change a 3.0, 3.5 or even 4.0B2 project on a machine that is still at 2.0 for example (maybe it's not mine nor do I have admin rights). I would like to checkout the project, the version of .net it requires (and other versioned libraries nunit, ninject, rhinomocks etc from the repository) make my change using Notepad2 or someother NON-Visual Studio editor (as VS would require an installation as well as the framework installed), run the build script and commit/push the changes. When that is done delete the checked out/cloned directories and files as if I was never even on that machine.

Background:
My repository is composed of many smaller unrelated projects, not like just one huge web app/site.
Why maintain versions of external libraries? Because I don't always want to update ALL projects at once. If I do there's a script for that.
Every developer is a telecommuting consultant. Who knows what's on their machine? Who cares everything(except .NET framework) is pointed to through the build script.
Maybe my machine dies and I need to use my grandmas. Maybe I'm on vacation and someones code is broke (not mine obviously) and I need to use the hotels.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

陪你搞怪i 2024-08-20 17:46:48

目前不支持这种情况。为了准确构建给定 .Net 风格的项目,您必须在计算机上安装相应的 .Net SDK(或者在某些情况下仅安装 redist)。没有办法从本质上将 .Net 框架纳入源代码控制。

This is not currently a supported scenario. In order to accurately build a project of a given .Net flavor, you must have the corresponding .Net SDK (or in some cases just the redist) installed on the machine. There is no way to essentially check the .Net framework into source code control.

乱世争霸 2024-08-20 17:46:48

不是挑剔,但这是否意味着他们不一定能运行他们正在构建的代码?如果是这样,那不是一个坏主意吗?

Not to pick nits, but wouldn't this mean they couldn't necessarily run the code they were building? And if so, wouldn't that be a bad idea?

猫腻 2024-08-20 17:46:48

不支持此操作。 MSBuild 随 .NET Framework 本身一起提供,因此如果您想使用 MSBuild 版本 X 进行构建,其中 X 为 (2.0/3.5/4.0),您需要安装相应的 .NET Framework 版本(或更高版本)建造建筑的机器。

由于您关心权限和运行不同版本的 .NET,您可能对 正在发布的 Visual Studio 2010 的实验室管理部分。

This is not supported. MSBuild is shipped with the .NET Framework itself so if you want to build using MSBuild version X where X is (2.0/3.5/4.0) you need the corresponding .NET Framework version (or higher) installed on the machine doing the building.

Since you are concerned with permissions and running different versions of .NET you may be interested in the Lab Management piece of Visual Studio 2010 which is being released.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文