使用 SVN 与 VS.NET 来版本编译代码时出现问题 - .svn 文件夹与 /bin 冲突
我正在使用 SVN 对我正在开发的 ASP.NET Web 项目进行版本控制。 我最近决定尝试对该网站的已发布版本进行版本控制。 我将它们与分支根目录中标记的代码发布版本一起提交到存储库。 事实证明这很有用,因为我可以使用 SVN 部署到我的服务器。
我面临的问题是,我必须对项目的 /bin 文件夹中的某些文件(没有外部引用的 DLL)进行版本控制,这创建了 /bin/.svn 文件夹。 问题是 VS.NET 的 Publish 命令坚持将 .svn 从开发分支 /bin 复制到输出文件夹的 /bin 。 这基本上是“切换”其中的二进制文件以指向 dev 分支。 结果是 /bin 文件夹的内容实际上从未提交到已编译的 bin 文件夹,因为工作副本指向存储库的不同部分。
有没有办法强制 Visual Studio 在发布时忽略 .svn 文件夹? 或者,是否有另一种方法可以处理项目中静态 .dll 的包含,而不将它们放入 bin 文件夹中,以便 /bin 可以从 SVN 中排除(应该如此)(不使用 GAC)?
I'm using SVN to version a ASP.NET web project that I'm working on. I have recently decided to try versioning published versions of the site. I commit these to the repository along with tagged Release versions of the code in the root of the branch. This is proving useful as I can deploy to my server using SVN.
Problem that I'm facing is that I've had to version some files in my project's /bin folder (DLLs without external references), which has created a /bin/.svn folder. Problem is that VS.NET's Publish command insists on copying the .svn from the development branch /bin to the output folder's /bin. This basically 'switches' the binary files in there to point to the dev branch. The result is that the contents of the /bin folder never actually get committed to the compiled bin folder, because the working copy is pointing to a different part of the repository.
Is there any way to force visual studio to ignore the .svn folder on publish? Alternately, is there another way to handle the inclusion of static .dlls in a project without putting them in the bin folder, so that the /bin can be excluded from SVN (as it should be) (not using the GAC)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
绝对不要将 bin 文件夹放入存储库中。 这会让你永远做噩梦。
只需将静态引用的 .dll 放在名为“Libraries”或其他名称的文件夹中,然后设置对它们的项目引用即可。 它们将自动复制到输出。
Definitely do not put the bin folder in the repository. This will give you nightmares forever.
Just put your static referenced .dll's in a folder called "Libraries" or whatever, and set your project references to them. They'll be copied to the output automatically.
我建议您不要对 .bin 文件夹中的任何内容进行版本控制。 而是将所有引用的程序集放在项目文件夹之外的文件夹中。 然后部署它并在它要去的任何地方构建它。 构建过程将根据需要拉取所有 dll。 这将解决 bin 文件夹中的 .svn 文件夹问题!
I suggest that you don't version anything in the .bin folder. Instead put all of your referenced assemblies in a folder outside of your project folders. Then deploy it and build it where ever it is going. The build process will pull all of the dlls in as needed. This would then remedy your .svn folder in the bin folder issue!
嗯..将它们放入解决方案中的单独文件夹中并引用它们。 现在我为什么没有想到这一点(哦!)。 我想我已经盯着屏幕太久了。
谢谢大家。
Hmm.. Put them into a separate folder in the solution and reference them. Now why didn't I think of that (doh!). Think I've been staring at the screen too long.
Thanks all.