Context
VS 2019, .NET Core 3 Preview 5. I've created a brand new ASP MVC Web App. Now examining the StartUp code:
// ...
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseCookiePolicy();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
//...
When I try to see what those extension methods are doing I go to the source (in my case ctrl+click and that invokes JetBrain decompiler) I get this:
// Decompiled with JetBrains decompiler
// Type: Microsoft.AspNetCore.Builder.AuthAppBuilderExtensions
// Assembly: Microsoft.AspNetCore.Authentication, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
// MVID: A1CE531C-37CE-4C8A-B143-24C2AC9CFE19
// Assembly location: C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\3.0.0-preview5-19227-01\ref\netcoreapp3.0\Microsoft.AspNetCore.Authentication.dll
namespace Microsoft.AspNetCore.Builder
{
/// <summary>
/// Extension methods to add authentication capabilities to an HTTP application pipeline.
/// </summary>
public static class AuthAppBuilderExtensions
{
/// <summary>
/// Adds the <see cref="T:Microsoft.AspNetCore.Authentication.AuthenticationMiddleware" /> to the specified <see cref="T:Microsoft.AspNetCore.Builder.IApplicationBuilder" />, which enables authentication capabilities.
/// </summary>
/// <param name="app">The <see cref="T:Microsoft.AspNetCore.Builder.IApplicationBuilder" /> to add the middleware to.</param>
/// <returns>A reference to this instance after the operation has completed.</returns>
public static IApplicationBuilder UseAuthentication(
this IApplicationBuilder app)
{
throw null;
}
}
}
Question
When I debug the code, I get no Exception
so it seems not that code is running. My conclusion, that what the project refers those are dummy empty assemblies, (see the // Assembly location: C:\Program Files...
comment line in the decompiled source) but I do not understand the mechanism why runtime other assemblies will be loaded?
Can anyone explain what actually happening here?