简体   繁体   English

更多信息:帮助构建VS2010解决方案/项目和TFS2010

[英]More on: Help Structuring VS2010 Solutions/Projects and TFS2010

This is a follow-on post to our previous post (Help Structuring VS2010 Solutions/Projects and TFS2010). 这是我们先前文章(帮助构建VS2010解决方案/项目和TFS2010)的后续文章。

We have a few questions regarding how to structure our VS2010 solutions and projects for best organization, as well as to save in and use TFS2010. 关于如何构造VS2010解决方案和项目以实现最佳组织,以及如何保存和使用TFS2010,我们有几个问题。

Currently, our code is structured something like: 当前,我们的代码结构如下:

/OverallAppName  
OverallAppName.sln  
-/Client  
-    -/WindowsFormsProject1  
WindowsFormsProject1.sln  
-    -/WindowsFormsProject2  
WindowsFormsProject2.sln  
-/Components  
-    -/ClassLibrary1 (common library referenced by other projects)  
ClassLibrary1.sln  
-    -/ClassLibrary2  
ClassLibrary2.sln  
-    -/ClassLibrary3  
ClassLibrary3.sln  
-    -/ClassLibrary4  
ClassLibrary4.sln  
-    -/ClassLibrary5  
ClassLibrary5.sln  
-/Server  
-    -/WindowsServiceProject1  
WindowsServiceProject1.sln  
-    -/WindowsServiceProject2  
    WindowsServiceProject2.sln  
-    -/WebProject1  
    WebProject1.sln  
-    -/WebProject2  
    WebProject2.sln  

Since, right now, we're in the process of moving from VSS to TFS2010, we're wanting to structure all our solutions/projects to be most efficient, most logical, easiest to maintain, easiest to reference, and easiest to use with and build in TFS2010, and we're needing some advice on the “best” way to structure everything with a partitioned solution model. 由于现在我们正在从VSS迁移到TFS2010,因此我们希望将所有解决方案/项目构建为最有效,最合逻辑,最易于维护,最易于引用且最易于使用并在TFS2010中进行构建,我们需要有关使用分区解决方案模型构建所有内容的“最佳”方法的一些建议。

Any suggestions????? 有什么建议么????? How can we structure all these different types of VS2010 projects into a logical structure that separate groups can work on individual pieces (not the entire solution), we can still have project references, we can stored in TFS2010 and build and branch in there, and follow “recommended best practices”? 我们如何才能将所有这些不同类型的VS2010项目构建为一个逻辑结构,使各个组可以在单独的部分上工作(而不是整个解决方案),我们仍然可以有项目引用,可以将其存储在TFS2010中并在其中构建和分支,以及是否遵循“推荐的最佳做法”?

Thanks. 谢谢。 (Sorry, I'm not sure the formatting came out very good.) (抱歉,我不确定格式是否很好。)

While I admire your commitment to trying to keep everything as one large solution, I think this is going to defeat some of the best features TFS has to offer in the realm of automated builds by sticking to this. 尽管我赞赏您致力于将所有内容作为一个大型解决方案的承诺,但我认为这将使TFS坚守这一点,从而破坏了TFS在自动构建领域必须提供的一些最佳功能。

The reason I say that is because you can use builds triggered by check-in to immediately build the code to prove it works (or better yet, use a Gated check-in). 我之所以这么说是因为您可以使用由签入触发的构建来立即构建代码以证明其有效(或者更好的是,使用Gated签入)。 The usefulness of these builds are inversely proportional to the time they take to run. 这些构建的有用性与运行时间成反比。 So if you have a massive solution that takes 20 minutes to build then it's going to take away from the advantages of those types of builds. 因此,如果您有一个庞大的解决方案,需要20分钟的构建时间,那么它将摆脱这些构建类型的优势。 If however you had several smaller solutions that took about 5 minutes each then you'll only get the modified solutions building on check-in and know the results sooner. 但是,如果您有几个较小的解决方案,每个解决方案大约花费5分钟,那么您只会在签入时获得修改后的解决方案,并尽快知道结果。

From what you've listed above I'd be inclined to have a solution for each set of artefacts that can be released separately. 从上面列出的内容来看,我倾向于为每种可以分别发布的人工制品提供一个解决方案。 In your example that's probably one for each of the clients, one for each of the web applications and one for all of the common libraries. 在您的示例中,每个客户端可能一个,每个Web应用程序一个,所有公共库一个。

Folder structure wise it'll not be much different to what you have above (assuming I'm interpreting it correctly) 明智的文件夹结构与上面的文件夹没有太大不同(假设我正确解释了它)

/OverallApplication
    /Clients
        /Client1
            -Client1.sln
            /Client1Project1
                -Client1Project1.csproj
            /Client1Project2
                -Client1Project1.csproj
            ...
         ...
    /Components
         -Components.sln
         /ClassLibrary1
             -ClassLibrary1.csproj
         /ClassLibrary2
             -ClassLibrary2.csproj
         ...
    /Server
        /WebApp1
            -WebApp1.sln
            /WebApp1Project1
                -WebApp1Project1.csproj
            /WebApp1Project2
                -WebApp1Project1.csproj
            ...
         ...     
    /CodeSigningKey
        -KeyPair.snk
    /ReferencedAssemblies
        /Manufacturer1
            -Manufacturer1Assembly1.dll
            ...
        ...

The common libraries can still be added as project references in the server and client solutions. 仍可以将公共库添加为服务器和客户端解决方案中的项目引用。 I've introduced a few new folders for common items such as the code signing key and 3rd party assemblies that are referenced (such as the Enterprise Library). 我为常见项目引入了一些新文件夹,例如代码签名密钥和所引用的第三方程序集(例如企业库)。

On top of that you'll want to employ a branching strategy of some kind to keep Main, Dev and Release code branches separate. 最重要的是,您将需要采用某种分支策略来使Main,Dev和Release代码分支保持分离。 I recommend a little light reading of the ALM Rangers branching guide on codeplex for that. 为此,我建议您稍微阅读一下Codeplex上的ALM Rangers分支指南。 http://vsarbranchingguide.codeplex.com/releases http://vsarbranchingguide.codeplex.com/releases

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

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