简体   繁体   English

如何为内部和外部站点组织VS解决方案

[英]How to organize VS solution for internal and external sites

I'm developing a web application that has intranet and internet facing sites. 我正在开发一个具有内部网和面向Internet站点的Web应用程序。 Each app will exist on a physically different server. 每个应用程序将存在于物理上不同的服务器上。 The different web apps will use lots of common code, so the big difference is really what functionality is available through the external site, which far less than what is on the internal version. 不同的Web应用程序将使用许多通用代码,因此最大的区别实际上是可通过外部站点使用的功能,远远少于内部版本的功能。 However, the external one will obviously have a different web.config, sitemap, etc., as well as some pages that only appear on the external one. 但是,外部页面显然将具有不同的web.config,站点地图等,以及仅出现在外部页面上的某些页面。

I'm wondering if there as a standard approach in .NET as to how to lay this out in the solution, both from a code management point of view as well as for deployment. 我想知道在.NET中是否存在从代码管理的角度以及在部署方面如何在解决方案中进行布局的标准方法。 I could easily do something simple like deploy the same app and all code to both servers, just perhaps with a different login page, and then use role based security to limit what external users see. 我可以轻松地做一些简单的事情,例如将相同的应用程序和所有代码部署到两台服务器上,只是使用不同的登录页面,然后使用基于角色的安全性来限制外部用户看到的内容。 However, this really smells to me as I hate the idea of having all sorts of files on the external server that don't need to be there. 但是,这对我来说真的很奇怪,因为我讨厌在外部服务器上存放不需要存在的各种文件的想法。

I would think there should be some way to lay out the solution such that they can draw on common code (including common pages). 我认为应该有某种解决方案的布局,以便他们可以借鉴通用代码(包括通用页面)。 Obviously DLLs built from other projects are not an issue to share, it is really how to share front-end pages, and to set up deployment differently for each one. 显然,从其他项目构建的DLL并不是要共享的问题,这实际上是如何共享前端页面以及如何为每个页面设置不同的部署。

Perhaps I can just put it all in the same Visual Studio Project and tweak an MSBuild script to do the dirty work? 也许我可以将它们全部放在同一个Visual Studio项目中,并调整MSBuild脚本来完成肮脏的工作?

Thanks for anything you can offer! 感谢您提供的任何东西!

Nobody seems to have any opinions on this, so I'll let you know what I'm planning on doing in case it helps anybody else. 似乎没有人对此有任何意见,因此,如果有帮助,我会让您知道我打算做什么。

I am going to lay out my Web project with External, Internal and Common folders. 我要展示我与外部,内部和公共文件夹的Web项目。 I am going to be using a Web setup project to help deploy my solution, I will have one setup project each for External and Internal, and I'm going to use file filters to exclude the pieces I don't want from whichever portion I am building (exclude Internal pages for the External build, and vice versa, while both will get Common pages/code). 我将使用一个Web安装项目来帮助部署我的解决方案,我将分别为外部和内部安装一个项目,并且我将使用文件过滤器从我的任何部分中排除不需要的部分正在构建(外部构建不包括内部页面,反之亦然,而两者都将获得通用页面/代码)。

This will allow me to bundle all of the web related code into the same VS project (and so easily leverage shared pages) while still only deploying the code that really needs to be on each server. 这将使我可以将所有与Web相关的代码捆绑到同一个VS项目中(从而轻松利用共享页面),同时仍然只部署真正需要在每台服务器上的代码。

I hope this makes sense! 我希望这是有道理的!

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

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