Mercurial和Visual Studio [英] Mercurial and Visual Studio

查看:63
本文介绍了Mercurial和Visual Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Visual Studio 2010专案.我通过命令行或TortoiseHG使用mercurial.我想开发一个新功能,所以我克隆了仓库.但是现在我很困惑,我是否应该将一个新项目导入到VS2010中来进行此功能?我尝试导入克隆的VS解决方案,但是由于找不到依赖项而导致大量构建错误,我认为这是因为我试图像原始解决方案一样加载此克隆解决方案,并且某些路径错误(不知道在哪里但是).

I have a visual studio 2010 project under mercurial. I use mercurial either via command line or TortoiseHG. I want to work on a new feature, so I clone the repo. But now I am confused, am I supposed to import an entire new project into VS2010 just to work on this feature? I tried importing the VS Solution that was cloned, but got lots of build errors from dependencies cannot be found errors, which I assume is because I am trying to load this cloned Solution just like the original Solution and some paths are wrong (no idea where though).

您应该如何使用Merurial和VS2010?

How are you supposed to use mercurial and VS2010?

推荐答案

克隆将生成原始存储库的精确副本.
克隆的工作方式应与原始存储库完全相同,因此,您打开的克隆解决方案与原始存储库完全相同.

Cloning produces an exact copy of the original repository.
The clone should work exactly the same way as the original repository, so you open your cloned solution exactly the same way as the original one.

如果在克隆的解决方案中出现构建错误,而在原始解决方案中却没有,则可能是某些依赖项(=应用程序需要正常工作的第三方程序集)存在于原始解决方案中,但并没有承诺存储库.
因此,当您克隆存储库时,克隆中缺少引用的文件...因此克隆将无法工作.

If you get build errors in the cloned solution but not in the original one, there are probably some dependencies (=3rd party assemblies that your application needs to work properly) which exist in the original solution, but weren't committed to the repository.
So, when you clone the repository, the referenced files are missing in the clone...so the clone won't work.

如果您签入完整的解决方案,包括所有依赖项,则源代码管理是最好的方法:
在解决方案中的某个位置创建一个"Libs"文件夹,将所有依赖项放入其中,从解决方案中引用那些文件,然后将整个"Libs"文件夹提交到存储库.

Source control works the best way if you check in the complete solution, including all dependencies:
Make a "Libs" folder somewhere in your solution, put all your dependencies inside, reference those files from your solution and commit the whole "Libs" folder to the repository.

如果采用这种方式,则可以从另一台计算机上克隆存储库并打开解决方案,而不必担心任何依赖关系……它可以正常工作.

If you do it this way, you can clone the repository from a different machine and open the solution, without worrying about any dependencies...it just works.

这篇关于Mercurial和Visual Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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