ASP。NET MVC多个内部网项目

时间:2022-03-05 01:36:18

I have been working on ASP.NET MVC for a while and loving it so far. But I am hitting a wall now.

我一直在做ASP。NET MVC已经有一段时间了,到目前为止都很喜欢它。但是我现在撞到墙上了。

I am working on a new intranet site, where I will have to host many projects, ranging from couple of pages to full blown applications. I have been using Areas to differentiate between the projects. It's all good so far.

我正在一个新的内部网站上工作,在那里我将不得不主持许多项目,从几页到完整的应用程序。我一直在利用不同的领域来区分不同的项目。到目前为止一切都很好。

Now, the solution is too big and every simple change I need to compile the whole projects which consists of all the areas (multiple projects). I am always afraid of making changes to live once I compile and upload the dll.

现在,解决方案太大了,我需要对包含所有领域(多个项目)的整个项目进行编译。我总是害怕一旦我编译并上传了dll,就会进行实时的修改。

Is there anyway that I can hold multiple projects sharing same layout but to compile each projects into separate dll?

我是否可以保持多个项目共享相同的布局,但将每个项目编译成单独的dll?

Thanks in advance

谢谢提前

EDIT

编辑

Thanks guys, I followed Portable Areas as an ASP.NET MVC Project and he seems to have explained things much easier in a step by step to get started.

谢谢大家,我使用了可移植区域作为ASP。NET MVC项目,他似乎已经一步一步地解释了事情,以便开始。

1 个解决方案

#1


2  

Have you considered using Portable Areas feature in the MVCContrib? - read a post about it here

你有没有考虑过在MVCContrib中使用便携式区域?-在这里读一篇关于它的文章

Also read the response from Eilon in another question Multiproject areas in ASP.Net MVC 3

也阅读来自Eilon在ASP的另一个多项目领域的回答。净MVC 3


If the portable area solution won't work for you then it's probably time for a refactor/restructure of your single web project into separate web projects. As it is an intranet site you'll probably want to setup some sub-domains to allow you run separate websites under the one domain.

如果可移植的区域解决方案对您不起作用,那么可能是时候将单个web项目重构/重构为单独的web项目了。因为它是一个内部网站点,所以您可能需要设置一些子域,以便在一个域下运行单独的站点。

Eg.

如。

www.yourdomain.com

www.yourdomain.com

admin.yourdomain.com

admin.yourdomain.com

calendar.yourdomain.com

calendar.yourdomain.com

etc.

等。

This way you can segregate your functionality and update different areas of the intranet without affecting others. You may of course need to look into single sign-on across your sub-domains depending on your site.

通过这种方式,您可以隔离您的功能并更新内部网的不同区域,而不会影响到其他人。当然,根据站点的不同,您可能需要研究跨子域的单点登录。

I would normally extract all common functionality into a core project (class library) which may be used by all of the web projects, and keep each your web projects as lightweight as possible. Then you can create separate solutions for different web projects or groups of web projects.

我通常会将所有的通用功能提取到一个核心项目(类库)中,这个项目可以被所有的web项目使用,并且尽可能地保持每个web项目的轻量级。然后您可以为不同的web项目或web项目组创建单独的解决方案。

Also consider looking into continuous integration/build server so that you can easily check if a change you make in one project is affecting other projects that may not be in your current solution.

还可以考虑查看持续集成/构建服务器,这样您就可以轻松地检查您在一个项目中所做的更改是否影响了其他可能不在您当前解决方案中的项目。

#1


2  

Have you considered using Portable Areas feature in the MVCContrib? - read a post about it here

你有没有考虑过在MVCContrib中使用便携式区域?-在这里读一篇关于它的文章

Also read the response from Eilon in another question Multiproject areas in ASP.Net MVC 3

也阅读来自Eilon在ASP的另一个多项目领域的回答。净MVC 3


If the portable area solution won't work for you then it's probably time for a refactor/restructure of your single web project into separate web projects. As it is an intranet site you'll probably want to setup some sub-domains to allow you run separate websites under the one domain.

如果可移植的区域解决方案对您不起作用,那么可能是时候将单个web项目重构/重构为单独的web项目了。因为它是一个内部网站点,所以您可能需要设置一些子域,以便在一个域下运行单独的站点。

Eg.

如。

www.yourdomain.com

www.yourdomain.com

admin.yourdomain.com

admin.yourdomain.com

calendar.yourdomain.com

calendar.yourdomain.com

etc.

等。

This way you can segregate your functionality and update different areas of the intranet without affecting others. You may of course need to look into single sign-on across your sub-domains depending on your site.

通过这种方式,您可以隔离您的功能并更新内部网的不同区域,而不会影响到其他人。当然,根据站点的不同,您可能需要研究跨子域的单点登录。

I would normally extract all common functionality into a core project (class library) which may be used by all of the web projects, and keep each your web projects as lightweight as possible. Then you can create separate solutions for different web projects or groups of web projects.

我通常会将所有的通用功能提取到一个核心项目(类库)中,这个项目可以被所有的web项目使用,并且尽可能地保持每个web项目的轻量级。然后您可以为不同的web项目或web项目组创建单独的解决方案。

Also consider looking into continuous integration/build server so that you can easily check if a change you make in one project is affecting other projects that may not be in your current solution.

还可以考虑查看持续集成/构建服务器,这样您就可以轻松地检查您在一个项目中所做的更改是否影响了其他可能不在您当前解决方案中的项目。