* Switch from using the embedded file provider for the precompiled views for actual razor precompilation. * Add MSBuild props and targets file to include additional assembly attributes on the generated precompiled views.
This commit is contained in:
parent
f1ed482c26
commit
d968fdd31f
|
|
@ -7,8 +7,9 @@
|
|||
"Microsoft.AspNetCore.Identity.UI": {
|
||||
"Exclusions": {
|
||||
"DOC_MISSING": {
|
||||
"lib/netstandard2.0/Microsoft.AspNetCore.Identity.UI.dll": "This is a library with packages UI"
|
||||
}
|
||||
"lib/netstandard2.0/Microsoft.AspNetCore.Identity.UI.dll": "This is a library with packaged UI",
|
||||
"lib/netstandard2.0/Microsoft.AspNetCore.Identity.UI.PrecompiledViews.dll": "This assembly is generated and contains precompiled razor pages"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,65 +3,66 @@
|
|||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Package Versions">
|
||||
<InternalAspNetCoreSdkPackageVersion>2.1.0-preview1-15651</InternalAspNetCoreSdkPackageVersion>
|
||||
<MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>
|
||||
<MicrosoftAspNetCoreAuthenticationFacebookPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreAuthenticationFacebookPackageVersion>
|
||||
<MicrosoftAspNetCoreAuthenticationGooglePackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreAuthenticationGooglePackageVersion>
|
||||
<MicrosoftAspNetCoreAuthenticationOpenIdConnectPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreAuthenticationOpenIdConnectPackageVersion>
|
||||
<MicrosoftAspNetCoreAuthenticationTwitterPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreAuthenticationTwitterPackageVersion>
|
||||
<MicrosoftAspNetCoreAuthorizationPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreAuthorizationPackageVersion>
|
||||
<MicrosoftAspNetCoreCryptographyKeyDerivationPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreCryptographyKeyDerivationPackageVersion>
|
||||
<MicrosoftAspNetCoreDataProtectionExtensionsPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreDataProtectionExtensionsPackageVersion>
|
||||
<MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion>
|
||||
<MicrosoftAspNetCoreDiagnosticsPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreDiagnosticsPackageVersion>
|
||||
<MicrosoftAspNetCoreHostingAbstractionsPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreHostingAbstractionsPackageVersion>
|
||||
<MicrosoftAspNetCoreHostingPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreHostingPackageVersion>
|
||||
<MicrosoftAspNetCoreHttpAbstractionsPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreHttpAbstractionsPackageVersion>
|
||||
<MicrosoftAspNetCoreHttpPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreHttpPackageVersion>
|
||||
<MicrosoftAspNetCoreMvcPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreMvcPackageVersion>
|
||||
<MicrosoftAspNetCoreMvcRazorViewCompilationPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreMvcRazorViewCompilationPackageVersion>
|
||||
<MicrosoftAspNetCoreMvcTestingPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreMvcTestingPackageVersion>
|
||||
<MicrosoftAspNetCoreRewritePackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreRewritePackageVersion>
|
||||
<MicrosoftAspNetCoreServerIISIntegrationPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreServerIISIntegrationPackageVersion>
|
||||
<MicrosoftAspNetCoreServerKestrelHttpsPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreServerKestrelHttpsPackageVersion>
|
||||
<MicrosoftAspNetCoreServerKestrelPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreServerKestrelPackageVersion>
|
||||
<MicrosoftAspNetCoreStaticFilesPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreStaticFilesPackageVersion>
|
||||
<MicrosoftAspNetCoreTestHostPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreTestHostPackageVersion>
|
||||
<MicrosoftAspNetCoreTestingPackageVersion>2.1.0-preview1-28061</MicrosoftAspNetCoreTestingPackageVersion>
|
||||
<InternalAspNetCoreSdkPackageVersion>2.1.0-preview1-15678</InternalAspNetCoreSdkPackageVersion>
|
||||
<MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>
|
||||
<MicrosoftAspNetCoreAuthenticationFacebookPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreAuthenticationFacebookPackageVersion>
|
||||
<MicrosoftAspNetCoreAuthenticationGooglePackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreAuthenticationGooglePackageVersion>
|
||||
<MicrosoftAspNetCoreAuthenticationOpenIdConnectPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreAuthenticationOpenIdConnectPackageVersion>
|
||||
<MicrosoftAspNetCoreAuthenticationTwitterPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreAuthenticationTwitterPackageVersion>
|
||||
<MicrosoftAspNetCoreAuthorizationPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreAuthorizationPackageVersion>
|
||||
<MicrosoftAspNetCoreCryptographyKeyDerivationPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreCryptographyKeyDerivationPackageVersion>
|
||||
<MicrosoftAspNetCoreDataProtectionExtensionsPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreDataProtectionExtensionsPackageVersion>
|
||||
<MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion>
|
||||
<MicrosoftAspNetCoreDiagnosticsPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreDiagnosticsPackageVersion>
|
||||
<MicrosoftAspNetCoreHostingAbstractionsPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreHostingAbstractionsPackageVersion>
|
||||
<MicrosoftAspNetCoreHostingPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreHostingPackageVersion>
|
||||
<MicrosoftAspNetCoreHttpAbstractionsPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreHttpAbstractionsPackageVersion>
|
||||
<MicrosoftAspNetCoreHttpPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreHttpPackageVersion>
|
||||
<MicrosoftAspNetCoreMvcPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreMvcPackageVersion>
|
||||
<MicrosoftAspNetCoreMvcRazorViewCompilationPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreMvcRazorViewCompilationPackageVersion>
|
||||
<MicrosoftAspNetCoreMvcTestingPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreMvcTestingPackageVersion>
|
||||
<MicrosoftAspNetCoreRazorDesignPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreRazorDesignPackageVersion>
|
||||
<MicrosoftAspNetCoreRewritePackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreRewritePackageVersion>
|
||||
<MicrosoftAspNetCoreServerIISIntegrationPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreServerIISIntegrationPackageVersion>
|
||||
<MicrosoftAspNetCoreServerKestrelHttpsPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreServerKestrelHttpsPackageVersion>
|
||||
<MicrosoftAspNetCoreServerKestrelPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreServerKestrelPackageVersion>
|
||||
<MicrosoftAspNetCoreStaticFilesPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreStaticFilesPackageVersion>
|
||||
<MicrosoftAspNetCoreTestHostPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreTestHostPackageVersion>
|
||||
<MicrosoftAspNetCoreTestingPackageVersion>2.1.0-preview1-28135</MicrosoftAspNetCoreTestingPackageVersion>
|
||||
<MicrosoftAspNetIdentityEntityFrameworkPackageVersion>2.2.1</MicrosoftAspNetIdentityEntityFrameworkPackageVersion>
|
||||
<MicrosoftAzureKeyVaultPackageVersion>2.3.2</MicrosoftAzureKeyVaultPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreInMemoryPackageVersion>2.1.0-preview1-28061</MicrosoftEntityFrameworkCoreInMemoryPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreRelationalPackageVersion>2.1.0-preview1-28061</MicrosoftEntityFrameworkCoreRelationalPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreSqlServerPackageVersion>2.1.0-preview1-28061</MicrosoftEntityFrameworkCoreSqlServerPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreToolsDotNetPackageVersion>2.1.0-preview1-28061</MicrosoftEntityFrameworkCoreToolsDotNetPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreToolsPackageVersion>2.1.0-preview1-28061</MicrosoftEntityFrameworkCoreToolsPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationBinderPackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsConfigurationBinderPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationCommandLinePackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
|
||||
<MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationFileExtensionsPackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsConfigurationFileExtensionsPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationJsonPackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsConfigurationJsonPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationPackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsConfigurationPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationUserSecretsPackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsConfigurationUserSecretsPackageVersion>
|
||||
<MicrosoftExtensionsDependencyInjectionPackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsDependencyInjectionPackageVersion>
|
||||
<MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>
|
||||
<MicrosoftExtensionsLoggingConfigurationPackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsLoggingConfigurationPackageVersion>
|
||||
<MicrosoftExtensionsLoggingConsolePackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsLoggingConsolePackageVersion>
|
||||
<MicrosoftExtensionsLoggingDebugPackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsLoggingDebugPackageVersion>
|
||||
<MicrosoftExtensionsLoggingPackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsLoggingPackageVersion>
|
||||
<MicrosoftExtensionsLoggingTestingPackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsLoggingTestingPackageVersion>
|
||||
<MicrosoftExtensionsOptionsConfigurationExtensionsPackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsOptionsConfigurationExtensionsPackageVersion>
|
||||
<MicrosoftExtensionsOptionsPackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsOptionsPackageVersion>
|
||||
<MicrosoftExtensionsRazorViewsSourcesPackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsRazorViewsSourcesPackageVersion>
|
||||
<MicrosoftExtensionsSecurityHelperSourcesPackageVersion>2.1.0-preview1-28061</MicrosoftExtensionsSecurityHelperSourcesPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreInMemoryPackageVersion>2.1.0-preview1-28135</MicrosoftEntityFrameworkCoreInMemoryPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreRelationalPackageVersion>2.1.0-preview1-28135</MicrosoftEntityFrameworkCoreRelationalPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreSqlServerPackageVersion>2.1.0-preview1-28135</MicrosoftEntityFrameworkCoreSqlServerPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreToolsDotNetPackageVersion>2.1.0-preview1-28135</MicrosoftEntityFrameworkCoreToolsDotNetPackageVersion>
|
||||
<MicrosoftEntityFrameworkCoreToolsPackageVersion>2.1.0-preview1-28135</MicrosoftEntityFrameworkCoreToolsPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationBinderPackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsConfigurationBinderPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationCommandLinePackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
|
||||
<MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationFileExtensionsPackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsConfigurationFileExtensionsPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationJsonPackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsConfigurationJsonPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationPackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsConfigurationPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationUserSecretsPackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsConfigurationUserSecretsPackageVersion>
|
||||
<MicrosoftExtensionsDependencyInjectionPackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsDependencyInjectionPackageVersion>
|
||||
<MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>
|
||||
<MicrosoftExtensionsLoggingConfigurationPackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsLoggingConfigurationPackageVersion>
|
||||
<MicrosoftExtensionsLoggingConsolePackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsLoggingConsolePackageVersion>
|
||||
<MicrosoftExtensionsLoggingDebugPackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsLoggingDebugPackageVersion>
|
||||
<MicrosoftExtensionsLoggingPackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsLoggingPackageVersion>
|
||||
<MicrosoftExtensionsLoggingTestingPackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsLoggingTestingPackageVersion>
|
||||
<MicrosoftExtensionsOptionsConfigurationExtensionsPackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsOptionsConfigurationExtensionsPackageVersion>
|
||||
<MicrosoftExtensionsOptionsPackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsOptionsPackageVersion>
|
||||
<MicrosoftExtensionsRazorViewsSourcesPackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsRazorViewsSourcesPackageVersion>
|
||||
<MicrosoftExtensionsSecurityHelperSourcesPackageVersion>2.1.0-preview1-28135</MicrosoftExtensionsSecurityHelperSourcesPackageVersion>
|
||||
<MicrosoftIdentityModelClientsActiveDirectoryPackageVersion>3.14.2</MicrosoftIdentityModelClientsActiveDirectoryPackageVersion>
|
||||
<MicrosoftIdentityModelProtocolsOpenIdConnectPackageVersion>5.2.0-preview2-41113220915</MicrosoftIdentityModelProtocolsOpenIdConnectPackageVersion>
|
||||
<MicrosoftNETCoreApp20PackageVersion>2.0.0</MicrosoftNETCoreApp20PackageVersion>
|
||||
<MicrosoftNETCoreApp21PackageVersion>2.1.0-preview1-26016-05</MicrosoftNETCoreApp21PackageVersion>
|
||||
<MicrosoftNETCoreApp21PackageVersion>2.1.0-preview1-26115-03</MicrosoftNETCoreApp21PackageVersion>
|
||||
<MicrosoftNETTestSdkPackageVersion>15.3.0</MicrosoftNETTestSdkPackageVersion>
|
||||
<MicrosoftOwinSecurityCookiesPackageVersion>3.0.1</MicrosoftOwinSecurityCookiesPackageVersion>
|
||||
<MicrosoftOwinSecurityInteropPackageVersion>2.1.0-preview1-28061</MicrosoftOwinSecurityInteropPackageVersion>
|
||||
<MicrosoftOwinSecurityInteropPackageVersion>2.1.0-preview1-28135</MicrosoftOwinSecurityInteropPackageVersion>
|
||||
<MoqPackageVersion>4.7.49</MoqPackageVersion>
|
||||
<SystemComponentModelAnnotationsPackageVersion>4.5.0-preview1-26016-05</SystemComponentModelAnnotationsPackageVersion>
|
||||
<SystemComponentModelAnnotationsPackageVersion>4.5.0-preview1-26112-01</SystemComponentModelAnnotationsPackageVersion>
|
||||
<XunitAnalyzersPackageVersion>0.8.0</XunitAnalyzersPackageVersion>
|
||||
<XunitPackageVersion>2.3.1</XunitPackageVersion>
|
||||
<XunitRunnerVisualStudioPackageVersion>2.3.1</XunitRunnerVisualStudioPackageVersion>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
version:2.1.0-preview1-15661
|
||||
commithash:c9349d4c8a495d3085d9b879214d80f2f45e2193
|
||||
version:2.1.0-preview1-15678
|
||||
commithash:5347461137cb45a77ddcc0b55b2478092de43338
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
@{
|
||||
Layout = "/Views/Shared/_Layout.cshtml";
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
@RenderBody()
|
||||
<hr />
|
||||
<footer>
|
||||
<p>© 2016 - IdentitySample</p>
|
||||
<p>© 2018 - IdentitySample.DefaultUI</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Identity.UI;
|
||||
using Microsoft.AspNetCore.Identity.UI.Services;
|
||||
using Microsoft.AspNetCore.Mvc.ApplicationParts;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
|
||||
|
|
@ -26,10 +31,73 @@ namespace Microsoft.AspNetCore.Identity
|
|||
/// <returns>The <see cref="IdentityBuilder"/>.</returns>
|
||||
public static IdentityBuilder AddDefaultUI(this IdentityBuilder builder)
|
||||
{
|
||||
AddAdditionalApplicationParts(builder);
|
||||
|
||||
builder.Services.ConfigureOptions<IdentityDefaultUIConfigureOptions>();
|
||||
builder.Services.TryAddTransient<IEmailSender, EmailSender>();
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
private static void AddAdditionalApplicationParts(IdentityBuilder builder)
|
||||
{
|
||||
// For preview1, we don't have a good mechanism to plug in additional parts.
|
||||
// We need to provide API surface to allow libraries to plug in existing parts
|
||||
// that were optionally added.
|
||||
// Challenges here are:
|
||||
// * Discovery of the parts.
|
||||
// * Ordering of the parts.
|
||||
// * Loading of the assembly in memory.
|
||||
var thisAssembly = typeof(IdentityBuilderUIExtensions).Assembly;
|
||||
var additionalReferences = thisAssembly
|
||||
.GetCustomAttributes<AssemblyMetadataAttribute>()
|
||||
.Where(am => string.Equals(am.Key, "Microsoft.AspNetCore.Mvc.AdditionalReference"))
|
||||
.Select(am => am.Value.Split(',')[0])
|
||||
.ToArray();
|
||||
|
||||
var mvcBuilder = builder.Services
|
||||
.AddMvc()
|
||||
.ConfigureApplicationPartManager(apm =>
|
||||
{
|
||||
foreach (var reference in additionalReferences)
|
||||
{
|
||||
var fileName = Path.GetFileName(reference);
|
||||
var filePath = Path.Combine(Path.GetDirectoryName(thisAssembly.Location), fileName);
|
||||
var additionalAssembly = LoadAssembly(filePath);
|
||||
// This needs to change to additional assembly part.
|
||||
var additionalPart = new AssemblyPart(additionalAssembly);
|
||||
if (!apm.ApplicationParts.Any(ap => HasSameName(ap.Name, additionalPart.Name)))
|
||||
{
|
||||
apm.ApplicationParts.Add(additionalPart);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
bool HasSameName(string left, string right) => string.Equals(left, right, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
private static Assembly LoadAssembly(string filePath)
|
||||
{
|
||||
Assembly viewsAssembly = null;
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
try
|
||||
{
|
||||
viewsAssembly = Assembly.LoadFile(filePath);
|
||||
}
|
||||
catch (FileLoadException)
|
||||
{
|
||||
throw new InvalidOperationException("Unable to load the precompiled views assembly in " +
|
||||
$"'{filePath}'.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException("Could not find the precompiled views assembly for 'Microsoft.AspNetCore.Identity.UI' at " +
|
||||
$"'{filePath}'.");
|
||||
}
|
||||
|
||||
return viewsAssembly;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5,7 +5,6 @@ using System;
|
|||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc.Razor;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.AspNetCore.StaticFiles;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
|
|
@ -15,7 +14,6 @@ namespace Microsoft.AspNetCore.Identity.UI
|
|||
{
|
||||
internal class IdentityDefaultUIConfigureOptions :
|
||||
IPostConfigureOptions<RazorPagesOptions>,
|
||||
IPostConfigureOptions<RazorViewEngineOptions>,
|
||||
IPostConfigureOptions<StaticFileOptions>,
|
||||
IPostConfigureOptions<CookieAuthenticationOptions>
|
||||
{
|
||||
|
|
@ -34,14 +32,6 @@ namespace Microsoft.AspNetCore.Identity.UI
|
|||
options.AllowAreas = true;
|
||||
}
|
||||
|
||||
public void PostConfigure(string name, RazorViewEngineOptions options)
|
||||
{
|
||||
name = name ?? throw new ArgumentNullException(nameof(name));
|
||||
options = options ?? throw new ArgumentNullException(nameof(options));
|
||||
|
||||
options.FileProviders.Add(new ManifestEmbeddedFileProvider(GetType().Assembly));
|
||||
}
|
||||
|
||||
public void PostConfigure(string name, StaticFileOptions options)
|
||||
{
|
||||
name = name ?? throw new ArgumentNullException(nameof(name));
|
||||
|
|
|
|||
|
|
@ -2,31 +2,47 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<Description>ASP.NET Core Identity UI is the default Razor Pages built-in UI for the ASP.NET Core Identity framework.</Description>
|
||||
<PrecompiledDescription>Precompiled views assembly for the ASP.NET Core Identity UI package.</PrecompiledDescription>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<GenerateDocumentationFile>false</GenerateDocumentationFile>
|
||||
<PackageTags>aspnetcore;identity;membership;razorpages</PackageTags>
|
||||
<EnableApiCheck>false</EnableApiCheck>
|
||||
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
|
||||
<RazorCompileOnBuild>true</RazorCompileOnBuild>
|
||||
<ResolvedRazorCompileToolset>RazorSdk</ResolvedRazorCompileToolset>
|
||||
<PrecompiledAssemblyTitle Condition=" '$(PrecompiledAssemblyTitle)' == '' ">$(RazorTargetName).dll</PrecompiledAssemblyTitle>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(MicrosoftAspNetCoreMvcPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="$(MicrosoftExtensionsFileProvidersEmbeddedPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="$(MicrosoftAspNetCoreStaticFilesPackageVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Areas/**/*.cshtml" />
|
||||
<Content Include="Areas/**/*.cshtml" />
|
||||
<EmbeddedResource Include="wwwroot/**/*" />
|
||||
<EmbeddedResource Remove="wwwroot/**/.bower.json" />
|
||||
<EmbeddedResource Remove="wwwroot/**/LICENSE*" />
|
||||
<None Remove="wwwroot/**/.bower.json" />
|
||||
<None Remove="wwwroot/**/LICENSE*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(MicrosoftAspNetCoreMvcPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="$(MicrosoftExtensionsFileProvidersEmbeddedPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="$(MicrosoftAspNetCoreRazorDesignPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="$(MicrosoftAspNetCoreStaticFilesPackageVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Identity\Microsoft.AspNetCore.Identity.csproj" />
|
||||
<ProjectReference Include="..\Stores\Microsoft.Extensions.Identity.Stores.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(MSBuildThisFileDirectory)Microsoft.AspNetCore.Identity.UI.props" />
|
||||
|
||||
<ItemGroup>
|
||||
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
|
||||
<_parameter1>Microsoft.AspNetCore.Mvc.AdditionalReference</_parameter1>
|
||||
<_parameter2>$(RazorTargetName).dll,false</_parameter2>
|
||||
</AssemblyAttribute>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(MSBuildThisFileDirectory)Microsoft.AspNetCore.Identity.UI.targets" />
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<GeneratePrecompiledAssemblyInfo Condition="'$(GeneratePrecompiledAssemblyInfo)' == ''">true</GeneratePrecompiledAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(GeneratePrecompiledAssemblyInfo)' == 'true'">
|
||||
<GeneratePrecompiledAssemblyCompanyAttribute Condition="'$(GeneratePrecompiledAssemblyCompanyAttribute)' == ''">true</GeneratePrecompiledAssemblyCompanyAttribute>
|
||||
<GeneratePrecompiledAssemblyConfigurationAttribute Condition="'$(GeneratePrecompiledAssemblyConfigurationAttribute)' == ''">true</GeneratePrecompiledAssemblyConfigurationAttribute>
|
||||
<GeneratePrecompiledAssemblyCopyrightAttribute Condition="'$(GeneratePrecompiledAssemblyCopyrightAttribute)' == ''">true</GeneratePrecompiledAssemblyCopyrightAttribute>
|
||||
<GeneratePrecompiledAssemblyDescriptionAttribute Condition="'$(GeneratePrecompiledAssemblyDescriptionAttribute)' == ''">true</GeneratePrecompiledAssemblyDescriptionAttribute>
|
||||
<GeneratePrecompiledAssemblyFileVersionAttribute Condition="'$(GeneratePrecompiledAssemblyFileVersionAttribute)' == ''">true</GeneratePrecompiledAssemblyFileVersionAttribute>
|
||||
<GeneratePrecompiledAssemblyInformationalVersionAttribute Condition="'$(GeneratePrecompiledAssemblyInformationalVersionAttribute)' == ''">true</GeneratePrecompiledAssemblyInformationalVersionAttribute>
|
||||
<GeneratePrecompiledAssemblyProductAttribute Condition="'$(GeneratePrecompiledAssemblyProductAttribute)' == ''">true</GeneratePrecompiledAssemblyProductAttribute>
|
||||
<GeneratePrecompiledAssemblyTitleAttribute Condition="'$(GeneratePrecompiledAssemblyTitleAttribute)' == ''">true</GeneratePrecompiledAssemblyTitleAttribute>
|
||||
<GeneratePrecompiledAssemblyVersionAttribute Condition="'$(GeneratePrecompiledAssemblyVersionAttribute)' == ''">true</GeneratePrecompiledAssemblyVersionAttribute>
|
||||
<GeneratePrecompiledNeutralResourcesLanguageAttribute Condition="'$(GeneratePrecompiledNeutralResourcesLanguageAttribute)' == ''">true</GeneratePrecompiledNeutralResourcesLanguageAttribute>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<RazorCompile Include="$(GeneratedCommitHashAttributeFile)" />
|
||||
<RazorCompile Include="$(GeneratedInternalAspNetCoreAttributeFile)" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
<Project>
|
||||
<!--
|
||||
Note that this must run before every invocation of CoreCompile to ensure that all compiler
|
||||
runs see the generated assembly info. There is at least one scenario involving Xaml
|
||||
where CoreCompile is invoked without other potential hooks such as Compile or CoreBuild,
|
||||
etc., so we hook directly on to CoreCompile. Furthermore, we must run *after*
|
||||
PrepareForBuild to ensure that the intermediate directory has been created.
|
||||
-->
|
||||
<Target Name="GeneratePrecompiledAssemblyInfo" BeforeTargets="RazorCoreCompile" DependsOnTargets="PrepareForRazorCompile;CoreGeneratePrecompiledAssemblyInfo" Condition="'$(GeneratePrecompiledAssemblyInfo)' == 'true'" />
|
||||
|
||||
<Target Name="GetPrecompiledAssemblyAttributes" DependsOnTargets="GetAssemblyVersion">
|
||||
<ItemGroup>
|
||||
<PrecompiledAssemblyAttribute Include="System.Reflection.AssemblyCompanyAttribute" Condition="'$(Company)' != '' and '$(GeneratePrecompiledAssemblyCompanyAttribute)' == 'true'">
|
||||
<_Parameter1>$(Company)</_Parameter1>
|
||||
</PrecompiledAssemblyAttribute>
|
||||
<PrecompiledAssemblyAttribute Include="System.Reflection.AssemblyConfigurationAttribute" Condition="'$(Configuration)' != '' and '$(GeneratePrecompiledAssemblyConfigurationAttribute)' == 'true'">
|
||||
<_Parameter1>$(Configuration)</_Parameter1>
|
||||
</PrecompiledAssemblyAttribute>
|
||||
<PrecompiledAssemblyAttribute Include="System.Reflection.AssemblyCopyrightAttribute" Condition="'$(Copyright)' != '' and '$(GeneratePrecompiledAssemblyCopyrightAttribute)' == 'true'">
|
||||
<_Parameter1>$(Copyright)</_Parameter1>
|
||||
</PrecompiledAssemblyAttribute>
|
||||
<PrecompiledAssemblyAttribute Include="System.Reflection.AssemblyDescriptionAttribute" Condition="'$(PrecompiledDescription)' != '' and '$(GeneratePrecompiledAssemblyDescriptionAttribute)' == 'true'">
|
||||
<_Parameter1>$(PrecompiledDescription)</_Parameter1>
|
||||
</PrecompiledAssemblyAttribute>
|
||||
<PrecompiledAssemblyAttribute Include="System.Reflection.AssemblyFileVersionAttribute" Condition="'$(FileVersion)' != '' and '$(GeneratePrecompiledAssemblyFileVersionAttribute)' == 'true'">
|
||||
<_Parameter1>$(FileVersion)</_Parameter1>
|
||||
</PrecompiledAssemblyAttribute>
|
||||
<PrecompiledAssemblyAttribute Include="System.Reflection.AssemblyInformationalVersionAttribute" Condition="'$(InformationalVersion)' != '' and '$(GeneratePrecompiledAssemblyInformationalVersionAttribute)' == 'true'">
|
||||
<_Parameter1>$(InformationalVersion)</_Parameter1>
|
||||
</PrecompiledAssemblyAttribute>
|
||||
<PrecompiledAssemblyAttribute Include="System.Reflection.AssemblyProductAttribute" Condition="'$(Product)' != '' and '$(GeneratePrecompiledAssemblyProductAttribute)' == 'true'">
|
||||
<_Parameter1>$(Product)</_Parameter1>
|
||||
</PrecompiledAssemblyAttribute>
|
||||
<PrecompiledAssemblyAttribute Include="System.Reflection.AssemblyTitleAttribute" Condition="'$(PrecompiledAssemblyTitle)' != '' and '$(GeneratePrecompiledAssemblyTitleAttribute)' == 'true'">
|
||||
<_Parameter1>$(PrecompiledAssemblyTitle)</_Parameter1>
|
||||
</PrecompiledAssemblyAttribute>
|
||||
<PrecompiledAssemblyAttribute Include="System.Reflection.AssemblyVersionAttribute" Condition="'$(AssemblyVersion)' != '' and '$(GeneratePrecompiledAssemblyVersionAttribute)' == 'true'">
|
||||
<_Parameter1>$(AssemblyVersion)</_Parameter1>
|
||||
</PrecompiledAssemblyAttribute>
|
||||
<PrecompiledAssemblyAttribute Include="System.Resources.NeutralResourcesLanguageAttribute" Condition="'$(NeutralLanguage)' != '' and '$(GeneratePrecompiledNeutralResourcesLanguageAttribute)' == 'true'">
|
||||
<_Parameter1>$(NeutralLanguage)</_Parameter1>
|
||||
</PrecompiledAssemblyAttribute>
|
||||
<PrecompiledAssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(BuildNumber)' != ''">
|
||||
<_Parameter1>BuildNumber</_Parameter1>
|
||||
<_Parameter2>$(BuildNumber)</_Parameter2>
|
||||
</PrecompiledAssemblyAttribute>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
To allow version changes to be respected on incremental builds (e.g. through CLI parameters),
|
||||
create a hash of all assembly attributes so that the cache file will change with the calculated
|
||||
assembly attribute values and msbuild will then execute CoreGenerateAssembly to generate a new file.
|
||||
-->
|
||||
<Target Name="CreateGeneratedPrecompiledAssemblyInfoInputsCacheFile" BeforeTargets="RazorCompile" DependsOnTargets="GetPrecompiledAssemblyAttributes">
|
||||
<PropertyGroup>
|
||||
<GeneratedPrecompiledAssemblyInfoFile>$(IntermediateOutputPath)$(MSBuildProjectName).PrecompiledViews.AssemblyInfo$(DefaultLanguageSourceExtension)</GeneratedPrecompiledAssemblyInfoFile>
|
||||
<GeneratedPrecompiledAssemblyInfoInputsCacheFile>$(IntermediateOutputPath)$(MSBuildProjectName).PrecompiledViews.AssemblyInfoInputs.cache</GeneratedPrecompiledAssemblyInfoInputsCacheFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- We only use up to _Parameter1 for most attributes, but other targets may add additional assembly attributes with multiple parameters. -->
|
||||
<Hash ItemsToHash="@(PrecompiledAssemblyAttribute->'%(Identity)%(_Parameter1)%(_Parameter2)%(_Parameter3)%(_Parameter4)%(_Parameter5)%(_Parameter6)%(_Parameter7)%(_Parameter8)')">
|
||||
<Output TaskParameter="HashResult" PropertyName="_PrecompiledAssemblyAttributesHash" />
|
||||
</Hash>
|
||||
|
||||
<WriteLinesToFile Lines="$(_PrecompiledAssemblyAttributesHash)" File="$(GeneratedPrecompiledAssemblyInfoInputsCacheFile)" Overwrite="True" WriteOnlyWhenDifferent="True" />
|
||||
|
||||
<ItemGroup>
|
||||
<FileWrites Include="$(GeneratedPrecompiledAssemblyInfoInputsCacheFile)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="CoreGeneratePrecompiledAssemblyInfo" DependsOnTargets="CreateGeneratedPrecompiledAssemblyInfoInputsCacheFile" Inputs="$(GeneratedPrecompiledAssemblyInfoInputsCacheFile)" Outputs="$(GeneratedPrecompiledAssemblyInfoFile)">
|
||||
<PropertyGroup>
|
||||
<GeneratedPrecompiledAssemblyInfoFile>$(IntermediateOutputPath)$(MSBuildProjectName).PrecompiledViews.AssemblyInfo$(DefaultLanguageSourceExtension)</GeneratedPrecompiledAssemblyInfoFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<!-- Ensure the generated assemblyinfo file is not already part of the Compile sources, as a workaround for https://github.com/dotnet/sdk/issues/114 -->
|
||||
<Compile Remove="$(GeneratedPrecompiledAssemblyInfoFile)" />
|
||||
<Compile Remove="$(GeneratedAssemblyInfoFile)" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<RazorCompile Include="$(GeneratedPrecompiledAssemblyInfoFile)" />
|
||||
</ItemGroup>
|
||||
|
||||
<WriteCodeFragment AssemblyAttributes="@(PrecompiledAssemblyAttribute)" Language="$(Language)" OutputFile="$(GeneratedPrecompiledAssemblyInfoFile)">
|
||||
<Output TaskParameter="OutputFile" ItemName="Compile" />
|
||||
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
|
||||
</WriteCodeFragment>
|
||||
</Target>
|
||||
</Project>
|
||||
Loading…
Reference in New Issue