Is Areas for ASP.NET Core the same as Portable Areas?

418 views Asked by At

I've seen references dating back 3+ years for Portable Areas in ASP.NET MVC, but then I ran across "Areas" for ASP.NET Core.

Are these the same thing?

Side question:

Is this something that is better solved with DI if you want to create an application with modularity or plugins?

1

There are 1 answers

0
Dmitry Sikorsky On

Using the ASP.NET Core Application parts feature you can easily put your area's controllers/view components inside another project and then use in the main web application. It is a bit more difficult with the views and static content. I prefer to add them as resources in the same projects as area controllers are located and then implement the IFileProvider interface and assign my implementation to the IHostingEnvironment.WebRootFileProvider property.

You can use ExtCore framework to make this all automatically.