简体   繁体   English

什么ASP.NET MVC项目文件应保存在存储库中?

[英]What ASP.NET MVC project files should be kept in a repository?

background:Me and my coworkers are working on asp.net mvc project ... we have a computer that works as a server which is where the project will be stored on... each of us has a copy of the project and we got tortoise cvs set up. 背景:我和我的同事正在开发asp.net mvc项目...我们有一台计算机作为服务器工作,项目将存储在...我们每个人都有一个项目的副本,我们得到了乌龟cvs成立。

questions: when you want to commit something, what files exactly do you commit?.. asp.net reports many dll files, csproj files, cs and sln files that appear to be different from the server's. 问题:当你想提交一些东西时,你提交的文件到底是什么?.. asp.net报告了许多与服务器不同的dll文件,csproj文件,cs和sln文件。

Maybe my question is not the right one I should ask so I would appreciate some insight on whats the best approach for working in groups. 也许我的问题不是我应该问的正确的问题,所以我希望能够深入了解哪些是团队合作的最佳方法。

The basic csproj file should be committed whenever you add or remove things from the project, to ensure that the project has all the correct files. 每当您从项目中添加或删除内容时,都应提交基本的csproj文件,以确保项目具有所有正确的文件。 The solution (sln) is a good one to commit, for the same reason, although I've also seen it done without. 解决方案(sln)是一个很好的提交,出于同样的原因,虽然我也看到它没有。 You'd also want to commit any cs files, naturally, as they're the main focus of things. 你自己也想要提交任何cs文件,因为它们是主要的焦点。

DLL files should only be committed if they're outside references--internal dlls to your project can be ignored, as they'll be built by each computer in turn. DLL文件只应在外部引用时提交 - 项目的内部dll可以忽略,因为它们将由每台计算机依次构建。 You also want to avoid .user files as unnecessary. 您还希望避免使用.user文件。 Ignore the 'bin' and 'obj' folders for each directory, when it comes to commits as well. 在提交时,忽略每个目录的'bin'和'obj'文件夹。

You really shouldn't check in anything that the project can generate itself. 你真的不应该检查项目可以生成的任何东西。 So no need to check in your bin or obj folders or anything like that, you also want to ignore any user preferences files. 所以不需要检查你的bin或obj文件夹或类似的东西,你也想忽略任何用户首选项文件。

This includes dlls, unless they are third party dlls, then you want to check them in to ensure everyone is working against the same version and this way you don't have to keep changing reference paths. 这包括dll, 除非它们是第三方dll,然后你想要检查它们以确保每个人都在使用相同的版本,这样你就不必不断更改引用路径。

I don't work in asp.net, so I will respond generically. 我不在asp.net工作,所以我会回答一般。 We have a subversion code repository for our version system, cvs works well too. 我们的版本系统有一个subversion代码库,cvs也很好用。 Developers retrieve all updated code from the repository, do work, make sure it's working correctly, do another get, re-compile, test, and then commit source code changes to the repository. 开发人员从存储库中检索所有更新的代码,执行工作,确保其正常工作,执行另一个获取,重新编译,测试,然后将源代码更改提交到存储库。 On a regular basis you can have a tool or manually build the application from the repository, and deploy to a testing server. 您可以定期使用工具或从存储库手动构建应用程序,并部署到测试服务器。 No compiled code should be placed in the repository. 不应将已编译的代码放在存储库中。

-Jay -Jay

We use the following project structure in SVN (but this applies to CVS as well). 我们在SVN中使用以下项目结构(但这也适用于CVS)。

+ tags
+ branches
> trunk
  + build (build scripts)
  + lib (external libraries)
  > src (source code)    
   >> Organization.App (solution name)
     >> Organization.App.Core (code library)
        + Config
        > Domain
          > Model
          > Persistence
          > Queries
          > Services
        > Persistence
        > Services
     >> Organization.App.Web (mvc web app)
        > Assets
          + Images
          + Scripts
          + Stylesheets
        + Controllers
        + Views
        + ViewModels

We put all our 3rd party dependencies into the lib folder. 我们将所有第三方依赖项放入lib文件夹中。 Including MVC, which can be bin deployed. 包括MVC,可以进行bin部署。 See this article by Phil Haack . 请参阅Phil Haack撰写的这篇文章 So when a new developer comes online all they have to do it check out the trunk, and they should have everything they need to get going. 因此,当一个新的开发人员上线所有他们必须检查后备箱,他们应该拥有他们需要的一切。 Using a CI server is a cinch because all of the projects dependencies are encapsulated by the lib folder and all of the visual studio projects make reference to those dll's in that lib folder. 使用CI服务器很简单,因为所有项目依赖项都由lib文件夹封装,并且所有visual studio项目都引用了该lib文件夹中的那些dll。

Does that make sense? 那有意义吗?

Never mind the core folder and the web folder. 别介意核心文件夹和Web文件夹。 That's just how we structure our projects within the solution. 这就是我们如何在解决方案中构建我们的项目。 But that's a whole other conversation . 但那是另一个完整的对话 :) :)

We keep everything except the BIN/OBJ folders in SVN. 除SVN中的BIN / OBJ文件夹外,我们保留所有内容。 We have all third party Libraries in a seperate folder that they are referenced from. 我们将所有第三方库放在一个单独的文件夹中,并引用它们。

Kindness, 善良,

Dan

If you are using a database change management tool, such as Tarantino , then you will also want to check in SQL change scripts and/or populate scripts. 如果您使用的是数据库更改管理工具(如Tarantino) ,那么您还需要签入SQL更改脚本和/或填充脚本。 We have a folder in our 'Core' solution where we keep these, ie 'Core/Database/Updates'. 我们的“核心”解决方案中有一个文件夹,我们保留这些文件夹,即“核心/数据库/更新”。 We use SQL Compare to find changes in our database then we check in those SQL change scripts so that other developers can just run them locally. 我们使用SQL Compare查找数据库中的更改,然后检查这些SQL更改脚本,以便其他开发人员可以在本地运行它们。 We have a nant task setup to call on Tarantino to sync up the other build environments (Dev, QA) and run any new change scripts. 我们有一个非常规的任务设置来调用Tarantino来同步其他构建环境(Dev,QA)并运行任何新的更改脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM