Created
July 10, 2018 12:05
-
-
Save GeorgDangl/6ba8339308857d6d04eb11c8880247c6 to your computer and use it in GitHub Desktop.
Excluding Assemblies from ASP.NET Core MVC Controller Discovery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddMvc() | |
// This allows to exclude some assembly from controller discovery | |
.ConfigureApplicationPartManager(a => | |
{ | |
var appPart = a.ApplicationParts.FirstOrDefault(ap => ap.Name == "Assembly.Name"); | |
if (appPart != null) | |
{ | |
a.ApplicationParts.Remove(appPart); | |
} | |
}) | |
.SetCompatibilityVersion(CompatibilityVersion.Version_2_1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment