DotNetCorePlugins/samples/aspnetcore-mvc
2022-06-04 21:23:10 -07:00
..
MvcApp Delete deprecated dependencies and drop support for everything < .NET 6 2022-06-04 21:09:40 -07:00
MvcAppPlugin1 Delete deprecated dependencies and drop support for everything < .NET 6 2022-06-04 21:09:40 -07:00
aspnetcore-mvc.sln Add a sample for loading ASP.NET MVC controllers from plugins 2018-10-22 18:23:07 -07:00
README.md Update release notes and README 2022-06-04 21:23:10 -07:00

ASP.NET Core MVC Sample

This sample contains 2 projects which demonstrate a simple plugin scenario.

  1. 'MvcWebApp' is an ASP.NET Core application which scans for a 'plugins' folder in its base directory and attempts to load any plugins it finds
  2. 'MvcAppPlugin1' which implements MVC controllers.

Normally, an ASP.NET Core MVC application must have a direct dependency on any assemblies which provide controllers. However, as this sample demonstrates, an MVC application can load controllers from a list of assemblies which is not known ahead of time when the host app is built.

Running the sample

Open a command line to this folder and run:

dotnet restore
dotnet run --project MvcApp/

Then open http://localhost:5000