如何在 Subversion 上将 ASP.NET 网站项目和类库项目放入一个 .sln 文件中

发布于 2024-08-24 22:42:32 字数 1368 浏览 4 评论 0原文

我的公司有几个类库,我们在多个网站项目(不是 Web 应用程序项目)中使用。网站项目没有 .sln 文件,但我确信我在过去的研究中读过,您可以制作一个空白解决方案并将您的网站和类库项目放入其中。

在回答了我之前的问题之后,这就是我要去的方向(稍微基于 http://amadiere.com/blog/2009/06/multiple-subversion-projects-in-one -visual-studio-solution-using-svnexternals/):

/websites
    /website1
        /trunk
            /website1
/libraries
    /library1
        /trunk
            /library1
    /library2
        /trunk
            /library2
    /etc...

然后我计划使用 svn:externals 将 /library1、/library2 等复制到working_copy/websites/website1/ 文件夹中。

我希望我的团队成员能够签出 website1 的 /trunk 文件夹并获取 .sln 文件、/library1 external、/library2 external 等。我希望该 .sln 文件包含 website1 网站项目以及所有库外部项目。希望这看起来像这样:

/working_copy
    /websites
        /website1
            /trunk
                /website1
                /library1 (svn:external of libraries/library1/trunk/library1) 
                /library2 (svn:external of libraries/library2/trunk/library2)
                /etc.
                website1.sln

所以,在这一切结束时,目标是我的队友检查后备箱,打开解决方案,每个人都有完全相同的解决方案。当我们提交时,所有内容都会被适当地提交到颠覆(网站代码和库都被提交到存储库上的适当位置)。

其他人是如何解决这些问题的?如何制作一个 .sln 文件供我和我的团队成员以这种方式共享?

My company has several class libraries we use in multiple website projects (not web application projects). Website projects don't have .sln files, but I'm sure I've read in my past research that you can make a blank solution and put your website and class library projects in it.

After answers to my previous questions, this is the direction that I'm going (based slightly on http://amadiere.com/blog/2009/06/multiple-subversion-projects-in-one-visual-studio-solution-using-svnexternals/):

/websites
    /website1
        /trunk
            /website1
/libraries
    /library1
        /trunk
            /library1
    /library2
        /trunk
            /library2
    /etc...

Then I planed on using svn:externals to copy /library1, /library2, and so on into the working_copy/websites/website1/ folder.

I want my team members to be able to checkout the /trunk folder for website1 and get a .sln file, /library1 external, /library2 external, etc. I want that .sln file to contain the website1 website project, and all of the library external projects. Hopefully that would look something like:

/working_copy
    /websites
        /website1
            /trunk
                /website1
                /library1 (svn:external of libraries/library1/trunk/library1) 
                /library2 (svn:external of libraries/library2/trunk/library2)
                /etc.
                website1.sln

So, at the end of all of this, the goal is that my teammates check out the trunk, open the solution, and everyone has the exact same solution. When we commit, everything is committed appropriately to subversion (the website code, and the libraries are committed to their appropriate place on the repo).

How have others solved these issues? How can I make a .sln file that my team members and I can share in this manner?

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

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

发布评论

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

评论(2

是你 2024-08-31 22:42:32

我认为你关于 svn 代码和解决方案文件结构的方法是正确的。正如您所描述的,使用 svn:externals 也是一个好主意。

要创建空白解决方案,只需选择“文件”->“新建”->“项目”,然后选择“其他项目类型”->“Visual Studio 解决方案”->“空白解决方案”。创建后,您可以使用菜单“文件”->“添加”向其中添加新的或现有的项目。

I think your approach about svn code and solution file structure is the right one. Also it is a good idea to use svn:externals as you described.

To create blank solution just select File->New->Project and choose Other Project Types->Visual Studio Solutions->Blank Solution. After you created it you can add new or existing projects to it using menu File->Add.

怪我入戏太深 2024-08-31 22:42:32

将库项目放入与网站项目相同的解决方案中不是一个好主意。让他们留在自己的解决方案中。在网站项目中,右键单击解决方案资源管理器中的项目,然后选择“添加引用”。指向您保存构建的库代码的位置(可能在文件共享上)。

It's a bad idea to put the library projects into the same solution as the web site project. Leave them in their own solution. In the web site project, right-click the project in solution explorer and choose "Add Reference". point to where you saved off the built library code (maybe on a file share).

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