简体   繁体   中英

How to organize VS solution for internal and external sites

I'm developing a web application that has intranet and internet facing sites. 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. 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.

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. 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.

Perhaps I can just put it all in the same Visual Studio Project and tweak an MSBuild script to do the dirty work?

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. 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).

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.

I hope this makes sense!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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