From c39a8b31099a7c464bf6b681f61ef7e7d30addf8 Mon Sep 17 00:00:00 2001 From: David Barker Date: Wed, 3 Mar 2021 15:51:44 +0800 Subject: [PATCH 1/7] Removed AspNet 2.2 dependencies Included Microsoft.Extensions.Identity.Core instead of Microsoft.AspNetCore.Identity Changed initialisation to return the IdentityBuilder so that the token providers can be set independently Had to remove AddDefaultTokenProviders as this is part of the AspNet 3.1 framework and not dotnet standard 2.1 --- src/AspNetCore.Identity.MongoDbCore.csproj | 4 +- src/Extensions/ServiceCollectionExtension.cs | 50 ++++++++++++-------- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/src/AspNetCore.Identity.MongoDbCore.csproj b/src/AspNetCore.Identity.MongoDbCore.csproj index 5bd3c4f..c7df969 100644 --- a/src/AspNetCore.Identity.MongoDbCore.csproj +++ b/src/AspNetCore.Identity.MongoDbCore.csproj @@ -13,8 +13,8 @@ - - + + diff --git a/src/Extensions/ServiceCollectionExtension.cs b/src/Extensions/ServiceCollectionExtension.cs index 8c96b20..3801a13 100644 --- a/src/Extensions/ServiceCollectionExtension.cs +++ b/src/Extensions/ServiceCollectionExtension.cs @@ -1,9 +1,10 @@ -using AspNetCore.Identity.MongoDbCore.Infrastructure; +using System; +using AspNetCore.Identity.MongoDbCore.Infrastructure; using AspNetCore.Identity.MongoDbCore.Models; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Identity.Core; using MongoDbGenericRepository; -using System; namespace AspNetCore.Identity.MongoDbCore.Extensions { @@ -19,14 +20,15 @@ namespace AspNetCore.Identity.MongoDbCore.Extensions /// The type of the primary key of the identity document. /// The collection of service descriptors. /// A configuration object of the AspNetCore.Identity.MongoDbCore package. - public static void ConfigureMongoDbIdentityUserOnly( + public static IdentityBuilder ConfigureMongoDbIdentityUserOnly( this IServiceCollection services, MongoDbIdentityConfiguration mongoDbIdentityConfiguration) where TUser : MongoIdentityUser, new() where TKey : IEquatable { ValidateMongoDbSettings(mongoDbIdentityConfiguration.MongoDbSettings); - CommonMongoDbSetup, TKey>(services, mongoDbIdentityConfiguration); + + return CommonMongoDbSetup, TKey>(services, mongoDbIdentityConfiguration); } @@ -36,11 +38,12 @@ namespace AspNetCore.Identity.MongoDbCore.Extensions /// The type representing a user. /// The collection of service descriptors. /// A configuration object of the AspNetCore.Identity.MongoDbCore package. - public static void ConfigureMongoDbIdentity(this IServiceCollection services, MongoDbIdentityConfiguration mongoDbIdentityConfiguration) + public static IdentityBuilder ConfigureMongoDbIdentity(this IServiceCollection services, MongoDbIdentityConfiguration mongoDbIdentityConfiguration) where TUser : MongoIdentityUser, new() { ValidateMongoDbSettings(mongoDbIdentityConfiguration.MongoDbSettings); - CommonMongoDbSetup(services, mongoDbIdentityConfiguration); + + return CommonMongoDbSetup(services, mongoDbIdentityConfiguration); } /// @@ -74,51 +77,60 @@ namespace AspNetCore.Identity.MongoDbCore.Extensions /// The collection of service descriptors. /// A configuration object of the AspNetCore.Identity.MongoDbCore package. /// An object representing a MongoDb connection. - public static void ConfigureMongoDbIdentity(this IServiceCollection services, MongoDbIdentityConfiguration mongoDbIdentityConfiguration, + public static IdentityBuilder ConfigureMongoDbIdentity(this IServiceCollection services, MongoDbIdentityConfiguration mongoDbIdentityConfiguration, IMongoDbContext mongoDbContext = null) where TUser : MongoIdentityUser, new() where TRole : MongoIdentityRole, new() where TKey : IEquatable { + IdentityBuilder builder; + ValidateMongoDbSettings(mongoDbIdentityConfiguration.MongoDbSettings); - if(mongoDbContext == null) + if (mongoDbContext == null) { - services.AddIdentity() + builder = services.AddIdentityCore() + .AddRoles() .AddMongoDbStores( mongoDbIdentityConfiguration.MongoDbSettings.ConnectionString, - mongoDbIdentityConfiguration.MongoDbSettings.DatabaseName) - .AddDefaultTokenProviders(); + mongoDbIdentityConfiguration.MongoDbSettings.DatabaseName); } else { - services.AddIdentity() - .AddMongoDbStores(mongoDbContext) - .AddDefaultTokenProviders(); + builder = services.AddIdentityCore() + .AddRoles() + .AddMongoDbStores(mongoDbContext); } if (mongoDbIdentityConfiguration.IdentityOptionsAction != null) { services.Configure(mongoDbIdentityConfiguration.IdentityOptionsAction); } + + return builder; } - private static void CommonMongoDbSetup(this IServiceCollection services, MongoDbIdentityConfiguration mongoDbIdentityConfiguration) + private static IdentityBuilder CommonMongoDbSetup(this IServiceCollection services, MongoDbIdentityConfiguration mongoDbIdentityConfiguration) where TUser : MongoIdentityUser, new() where TRole : MongoIdentityRole, new() where TKey : IEquatable { - services.AddIdentity() + + IdentityBuilder builder; + + builder = services.AddIdentityCore() + .AddRoles() .AddMongoDbStores( - mongoDbIdentityConfiguration.MongoDbSettings.ConnectionString, - mongoDbIdentityConfiguration.MongoDbSettings.DatabaseName) - .AddDefaultTokenProviders(); + mongoDbIdentityConfiguration.MongoDbSettings.ConnectionString, + mongoDbIdentityConfiguration.MongoDbSettings.DatabaseName); if (mongoDbIdentityConfiguration.IdentityOptionsAction != null) { services.Configure(mongoDbIdentityConfiguration.IdentityOptionsAction); } + + return builder; } } } From 91329b86531718b510ab923eb1005c600b362718 Mon Sep 17 00:00:00 2001 From: David Barker Date: Wed, 3 Mar 2021 16:04:49 +0800 Subject: [PATCH 2/7] Updated tests based on changes to AspNet Identity Core Added .AddDefaultTokenProviders() after the call to ConfigureMongoDbIdentity Note: There are four places in the test project Added .AddAuthentication() to register all the authentication types Fixed aspnetsettings.json IncludeScopes to empty object, not false Updated unit test packages to latest version Added project reference for unit test rather than package reference Removed all references to AspNet framework assemblies as these are now part of the netcoreapp3.1 --- .gitignore | 8 ++++-- .../MongoIdentitySample.Mvc/appsettings.json | 2 +- ...entity.MongoDbCore.IntegrationTests.csproj | 26 ++++++++++--------- .../MongoDbStoreTestBase.cs | 17 +++++++----- .../UserStoreTest.cs | 12 ++++----- .../IdentitySpecificationTestBase.cs | 24 ++++++++++------- .../appsettings.json | 2 +- .../test.ps1 | 7 +++++ 8 files changed, 59 insertions(+), 39 deletions(-) create mode 100644 test/AspNetCore.Identity.MongoDbCore.IntegrationTests/test.ps1 diff --git a/.gitignore b/.gitignore index 827bbf5..c85705e 100644 --- a/.gitignore +++ b/.gitignore @@ -297,5 +297,9 @@ __pycache__/ *.btm.cs *.odx.cs *.xsd.cs -sample/MongoIdentitySample.Mvc/appsettings.local.json -test/AspNetCore.Identity.MongoDbCore.IntegrationTests/appsettings.local.json + +# Local app settings for development +**/**/appsettings.local.json + +# Output from the code coverage analysis +**/**/coverage.json \ No newline at end of file diff --git a/sample/MongoIdentitySample.Mvc/appsettings.json b/sample/MongoIdentitySample.Mvc/appsettings.json index 5c53f25..1e27be6 100644 --- a/sample/MongoIdentitySample.Mvc/appsettings.json +++ b/sample/MongoIdentitySample.Mvc/appsettings.json @@ -4,7 +4,7 @@ "DatabaseName": "MongoDbTests" }, "Logging": { - "IncludeScopes": false, + "IncludeScopes": {}, "LogLevel": { "Default": "Warning" } diff --git a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.MongoDbCore.IntegrationTests.csproj b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.MongoDbCore.IntegrationTests.csproj index 3c85947..78a7e6b 100644 --- a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.MongoDbCore.IntegrationTests.csproj +++ b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.MongoDbCore.IntegrationTests.csproj @@ -7,23 +7,21 @@ - - - - - - - - - - - - + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -35,4 +33,8 @@ Always + + + + diff --git a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.MongoDbCore.Test/MongoDbStoreTestBase.cs b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.MongoDbCore.Test/MongoDbStoreTestBase.cs index 68a7918..fa1f91e 100644 --- a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.MongoDbCore.Test/MongoDbStoreTestBase.cs +++ b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.MongoDbCore.Test/MongoDbStoreTestBase.cs @@ -6,23 +6,23 @@ using System.Linq; using System.Linq.Expressions; using System.Security.Claims; using System.Threading.Tasks; +using AspNetCore.Identity.MongoDbCore.Extensions; +using AspNetCore.Identity.MongoDbCore.IntegrationTests.Infrastructure; +using AspNetCore.Identity.MongoDbCore.Models; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity.Test; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Xunit; -using AspNetCore.Identity.MongoDbCore.Models; -using AspNetCore.Identity.MongoDbCore.Extensions; using MongoDB.Driver; -using AspNetCore.Identity.MongoDbCore.IntegrationTests.Infrastructure; using MongoDbGenericRepository; -using Microsoft.AspNetCore.Identity; +using Xunit; namespace AspNetCore.Identity.MongoDbCore.Test { // TODO: Add test variation with non IdentityDbContext - public abstract class MongoDbStoreTestBase : IdentitySpecificationTestBase, + public abstract class MongoDbStoreTestBase : IdentitySpecificationTestBase, IClassFixture> where TUser : MongoIdentityUser, new() where TRole : MongoIdentityRole, new() @@ -39,9 +39,12 @@ namespace AspNetCore.Identity.MongoDbCore.Test { services.AddSingleton(); // configure the default type name - services.ConfigureMongoDbIdentity(Container.MongoDbIdentityConfiguration, Container.MongoRepository.Context); + services.ConfigureMongoDbIdentity(Container.MongoDbIdentityConfiguration, Container.MongoRepository.Context) + .AddDefaultTokenProviders(); + services.AddAuthentication(); services.AddLogging(); + services.AddSingleton>>(new TestLogger>()); services.AddSingleton>>(new TestLogger>()); } diff --git a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.MongoDbCore.Test/UserStoreTest.cs b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.MongoDbCore.Test/UserStoreTest.cs index dd877af..5f8765a 100644 --- a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.MongoDbCore.Test/UserStoreTest.cs +++ b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.MongoDbCore.Test/UserStoreTest.cs @@ -4,13 +4,13 @@ using System; using System.Linq.Expressions; using System.Threading.Tasks; +using AspNetCore.Identity.MongoDbCore.IntegrationTests.Infrastructure; +using AspNetCore.Identity.MongoDbCore.Models; +using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity.Test; using Microsoft.Extensions.DependencyInjection; -using Xunit; -using AspNetCore.Identity.MongoDbCore.Models; -using AspNetCore.Identity.MongoDbCore.IntegrationTests.Infrastructure; using MongoDbGenericRepository; -using Microsoft.AspNetCore.Identity; +using Xunit; namespace AspNetCore.Identity.MongoDbCore.Test { @@ -308,8 +308,8 @@ namespace AspNetCore.Identity.MongoDbCore.Test { // Arrange const string originalEmail = "original@email.com"; - const string newEmail1 = "new1@email.com"; - const string newEmail2 = "new2@email.com"; + string newEmail1 = $"new{DateTime.Now.Ticks}@email.com"; + string newEmail2 = $"new{DateTime.Now.Ticks+1}@email.com"; var user = CreateTestUser(); user.Email = originalEmail; var manager = CreateManager(); diff --git a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/Specification/IdentitySpecificationTestBase.cs b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/Specification/IdentitySpecificationTestBase.cs index 64d1078..60479ce 100644 --- a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/Specification/IdentitySpecificationTestBase.cs +++ b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/Specification/IdentitySpecificationTestBase.cs @@ -7,14 +7,14 @@ using System.Linq; using System.Linq.Expressions; using System.Security.Claims; using System.Threading.Tasks; +using AspNetCore.Identity.MongoDbCore.Extensions; +using AspNetCore.Identity.MongoDbCore.Infrastructure; +using AspNetCore.Identity.MongoDbCore.IntegrationTests.Infrastructure; +using AspNetCore.Identity.MongoDbCore.Models; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Xunit; -using AspNetCore.Identity.MongoDbCore.Models; -using AspNetCore.Identity.MongoDbCore.Extensions; -using AspNetCore.Identity.MongoDbCore.Infrastructure; -using AspNetCore.Identity.MongoDbCore.IntegrationTests.Infrastructure; namespace Microsoft.AspNetCore.Identity.Test { @@ -48,7 +48,10 @@ namespace Microsoft.AspNetCore.Identity.Test protected override void SetupIdentityServices(IServiceCollection services) { services.AddSingleton(); - services.ConfigureMongoDbIdentity(Container.MongoDbIdentityConfiguration, Container.MongoRepository.Context); + services.ConfigureMongoDbIdentity(Container.MongoDbIdentityConfiguration, Container.MongoRepository.Context) + .AddDefaultTokenProviders(); + services.AddAuthentication(); + services.AddLogging(); services.AddSingleton>>(new TestLogger>()); services.AddSingleton>>(new TestLogger>()); @@ -64,14 +67,15 @@ namespace Microsoft.AspNetCore.Identity.Test services.AddSingleton(); if (concurrentSetup) { - services.ConfigureMongoDbIdentity(Container.MongoDbIdentityConfiguration, Container.MongoRepositoryConcurrent.Context); + services.ConfigureMongoDbIdentity(Container.MongoDbIdentityConfiguration, Container.MongoRepositoryConcurrent.Context).AddDefaultTokenProviders(); } else { - services.ConfigureMongoDbIdentity(Container.MongoDbIdentityConfiguration, Container.MongoRepository.Context); + services.ConfigureMongoDbIdentity(Container.MongoDbIdentityConfiguration, Container.MongoRepository.Context).AddDefaultTokenProviders(); } - + services.AddLogging(); + services.AddAuthentication(); services.AddSingleton>>(new TestLogger>()); services.AddSingleton>>(new TestLogger>()); } @@ -104,7 +108,7 @@ namespace Microsoft.AspNetCore.Identity.Test services = new ServiceCollection(); } - if(context == null) + if (context == null) { SetupIdentityServices(services); } @@ -112,7 +116,7 @@ namespace Microsoft.AspNetCore.Identity.Test { SetupIdentityServices(services, true); } - + return services.BuildServiceProvider().GetService>(); } diff --git a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/appsettings.json b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/appsettings.json index 5c53f25..1e27be6 100644 --- a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/appsettings.json +++ b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/appsettings.json @@ -4,7 +4,7 @@ "DatabaseName": "MongoDbTests" }, "Logging": { - "IncludeScopes": false, + "IncludeScopes": {}, "LogLevel": { "Default": "Warning" } diff --git a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/test.ps1 b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/test.ps1 new file mode 100644 index 0000000..dbc71a3 --- /dev/null +++ b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/test.ps1 @@ -0,0 +1,7 @@ + +Write-Output "" +Write-Output "Running Tests with Code Coverage" +Write-Output "" + + +& 'dotnet' test /p:CollectCoverage=true From 4c8bd6a2250a23923242c42162134666bb64c5eb Mon Sep 17 00:00:00 2001 From: David Barker Date: Wed, 3 Mar 2021 16:54:23 +0800 Subject: [PATCH 3/7] Removed AspNet 2.2 dependencies from test application --- .../MongoIdentitySample.Mvc.csproj | 28 +++++++++---------- sample/MongoIdentitySample.Mvc/Startup.cs | 26 ++++++++--------- .../IdentitySpecificationTestBase.cs | 6 ++-- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/sample/MongoIdentitySample.Mvc/MongoIdentitySample.Mvc.csproj b/sample/MongoIdentitySample.Mvc/MongoIdentitySample.Mvc.csproj index 278fafd..9f63488 100644 --- a/sample/MongoIdentitySample.Mvc/MongoIdentitySample.Mvc.csproj +++ b/sample/MongoIdentitySample.Mvc/MongoIdentitySample.Mvc.csproj @@ -8,20 +8,15 @@ - - - - - - - - - - - - - - + + + + + + + + + @@ -35,5 +30,10 @@ Always + + + + + diff --git a/sample/MongoIdentitySample.Mvc/Startup.cs b/sample/MongoIdentitySample.Mvc/Startup.cs index cbf26a8..aaa36a5 100644 --- a/sample/MongoIdentitySample.Mvc/Startup.cs +++ b/sample/MongoIdentitySample.Mvc/Startup.cs @@ -1,15 +1,15 @@ -using AspNetCore.Identity.MongoDbCore.Infrastructure; +using System; +using AspNetCore.Identity.MongoDbCore.Infrastructure; using AspNetCore.Identity.MongoDbCore.Models; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; using MongoIdentitySample.Mvc.Models; using MongoIdentitySample.Mvc.Services; -using Microsoft.Extensions.Logging; -using System; namespace MongoIdentitySample.Mvc { @@ -24,7 +24,7 @@ namespace MongoIdentitySample.Mvc .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) //per user config that is not committed to repo, use this to override settings (e.g. connection string) based on your local environment. - .AddJsonFile($"appsettings.local.json", optional: true); + .AddJsonFile($"appsettings.local.json", optional: true); builder.AddEnvironmentVariables(); Configuration = builder.Build(); @@ -48,16 +48,15 @@ namespace MongoIdentitySample.Mvc var builder = services.AddRazorPages(); - - #if DEBUG - if(_env.IsDevelopment()) - { - builder.AddRazorRuntimeCompilation(); - } - #endif + +#if DEBUG + if (_env.IsDevelopment()) + { + builder.AddRazorRuntimeCompilation(); + } +#endif services.AddMvc(); - services.AddApplicationInsightsTelemetry(); // Add application services. @@ -71,7 +70,6 @@ namespace MongoIdentitySample.Mvc if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); - app.UseBrowserLink(); } else { diff --git a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/Specification/IdentitySpecificationTestBase.cs b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/Specification/IdentitySpecificationTestBase.cs index 60479ce..6f15f0b 100644 --- a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/Specification/IdentitySpecificationTestBase.cs +++ b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/Specification/IdentitySpecificationTestBase.cs @@ -67,11 +67,13 @@ namespace Microsoft.AspNetCore.Identity.Test services.AddSingleton(); if (concurrentSetup) { - services.ConfigureMongoDbIdentity(Container.MongoDbIdentityConfiguration, Container.MongoRepositoryConcurrent.Context).AddDefaultTokenProviders(); + services.ConfigureMongoDbIdentity(Container.MongoDbIdentityConfiguration, Container.MongoRepositoryConcurrent.Context) + .AddDefaultTokenProviders(); } else { - services.ConfigureMongoDbIdentity(Container.MongoDbIdentityConfiguration, Container.MongoRepository.Context).AddDefaultTokenProviders(); + services.ConfigureMongoDbIdentity(Container.MongoDbIdentityConfiguration, Container.MongoRepository.Context) + .AddDefaultTokenProviders(); } services.AddLogging(); From 21082165d6febdc5cd2d0e26072475c4ea0431f8 Mon Sep 17 00:00:00 2001 From: David Barker Date: Wed, 3 Mar 2021 17:24:09 +0800 Subject: [PATCH 4/7] Update nuspec to 3.1 version to match aspnetcore3.1 Add pack.ps1 to build the nuget package using dotnet pack --- src/AspNetCore.Identity.MongoDbCore.nuspec | 8 ++++---- src/pack.ps1 | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 src/pack.ps1 diff --git a/src/AspNetCore.Identity.MongoDbCore.nuspec b/src/AspNetCore.Identity.MongoDbCore.nuspec index 7db6350..0539030 100644 --- a/src/AspNetCore.Identity.MongoDbCore.nuspec +++ b/src/AspNetCore.Identity.MongoDbCore.nuspec @@ -2,26 +2,26 @@ AspNetCore.Identity.MongoDbCore - 2.1.1 + 3.1.0 AspNetCore.Identity.MongoDbCore Alexandre Spieser Alexandre Spieser MIT https://github.com/alexandre-spieser/AspNetCore.Identity.MongoDbCore false - A MongoDb UserStore and RoleStore adapter for Microsoft.AspNetCore.Identity 2.2. + A MongoDb UserStore and RoleStore adapter for Microsoft.Extensions.Identity.Core 3.1. Release notes are at https://github.com/alexandre-spieser/AspNetCore.Identity.MongoDbCore/releases Copyright 2020 (c) Alexandre Spieser. All rights reserved. aspnetcore mongo mongodb identity membership - + - + diff --git a/src/pack.ps1 b/src/pack.ps1 new file mode 100644 index 0000000..fb84563 --- /dev/null +++ b/src/pack.ps1 @@ -0,0 +1,6 @@ + +Write-Output "Package AspNetCore.Identity.MongoDbCore" + +Remove-Item -Path "./bin/Release" -Force -Recurse + +& dotnet pack -c Release -p:NuspecFile=AspNetCore.Identity.MongoDbCore.nuspec \ No newline at end of file From 7566643369823c05a97a09be52e761c82555afbd Mon Sep 17 00:00:00 2001 From: David Barker Date: Thu, 4 Mar 2021 00:35:20 +0800 Subject: [PATCH 5/7] Issues with the version number as 3.1.1 nuspec suggests that this is greater than or equal to VS code reports error, changing this to 3.1.12 resolves this error? --- src/AspNetCore.Identity.MongoDbCore.csproj | 2 ++ src/AspNetCore.Identity.MongoDbCore.nuspec | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/AspNetCore.Identity.MongoDbCore.csproj b/src/AspNetCore.Identity.MongoDbCore.csproj index c7df969..d9481ec 100644 --- a/src/AspNetCore.Identity.MongoDbCore.csproj +++ b/src/AspNetCore.Identity.MongoDbCore.csproj @@ -2,6 +2,8 @@ netcoreapp3.1;netstandard2.1 + 3.1.0 + 3.1.0 diff --git a/src/AspNetCore.Identity.MongoDbCore.nuspec b/src/AspNetCore.Identity.MongoDbCore.nuspec index 0539030..7161e81 100644 --- a/src/AspNetCore.Identity.MongoDbCore.nuspec +++ b/src/AspNetCore.Identity.MongoDbCore.nuspec @@ -15,16 +15,16 @@ aspnetcore mongo mongodb identity membership - - + + - - - - + + + + From 512f2fefa40ef3783634d447d84fea96f9064f83 Mon Sep 17 00:00:00 2001 From: David Barker Date: Thu, 4 Mar 2021 11:59:13 +0800 Subject: [PATCH 6/7] Resolved issue with Nuget package versions, Setting min value to 3.1.8 To override this include the version of the dependency that you want to use in the project, 3.1.12 is recommended --- src/AspNetCore.Identity.MongoDbCore.nuspec | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/AspNetCore.Identity.MongoDbCore.nuspec b/src/AspNetCore.Identity.MongoDbCore.nuspec index 7161e81..c88b0f4 100644 --- a/src/AspNetCore.Identity.MongoDbCore.nuspec +++ b/src/AspNetCore.Identity.MongoDbCore.nuspec @@ -15,16 +15,16 @@ aspnetcore mongo mongodb identity membership - - - - + + + + - - - - + + + + From af725717bb1d3bd6537fc03ae0a0ada2f1cda472 Mon Sep 17 00:00:00 2001 From: David Barker Date: Thu, 4 Mar 2021 18:13:11 +0800 Subject: [PATCH 7/7] Resore app.UseBrowserLink(); --- sample/MongoIdentitySample.Mvc/Startup.cs | 1 + src/AspNetCore.Identity.MongoDbCore.csproj | 1 + 2 files changed, 2 insertions(+) diff --git a/sample/MongoIdentitySample.Mvc/Startup.cs b/sample/MongoIdentitySample.Mvc/Startup.cs index aaa36a5..1c4fd58 100644 --- a/sample/MongoIdentitySample.Mvc/Startup.cs +++ b/sample/MongoIdentitySample.Mvc/Startup.cs @@ -70,6 +70,7 @@ namespace MongoIdentitySample.Mvc if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); + app.UseBrowserLink(); } else { diff --git a/src/AspNetCore.Identity.MongoDbCore.csproj b/src/AspNetCore.Identity.MongoDbCore.csproj index d9481ec..1b6e513 100644 --- a/src/AspNetCore.Identity.MongoDbCore.csproj +++ b/src/AspNetCore.Identity.MongoDbCore.csproj @@ -17,6 +17,7 @@ +