aspnet / Identity

[Archived] ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
1.97k stars 871 forks source link

Update Jquery.validation.Unobtrusive #1999

Closed ryanbrandenburg closed 5 years ago

ryanbrandenburg commented 5 years ago

Part of https://github.com/aspnet/Templating/issues/32.

Things I also did while I was at it:

@javiercn let me know if any of this needs to remain unchanged do to legacy. For example, should we just revert all the changes I made in */V3?

javiercn commented 5 years ago

What manual testing have you done on these changes?

ryanbrandenburg commented 5 years ago

To test I launched test/WebSites/Identity.DefaultUI.WebSite (bootstrap4) and test/WebSites/Identity.OpenIdConnect.WebSite (bootstrap3), confirmed that they had no errors in the console, looked about right, and that when you tried to submit an empty form you got the appropriate warnings in the UI.

javiercn commented 5 years ago

@ryanbrandenburg You need to run the app in development and in production, launching it (I assume with F5 or dotnet run) is not good enough. We don't care about test/WebSites/Identity.OpenIdConnect.WebSite but for the default UI you need to run it on both environments as described above and make sure that there are no errors on the browser console (Visit login/register/manage)

ryanbrandenburg commented 5 years ago

I assume by that you mean:

If so I've now tested it that way and we get no errors and working pages both ways.

javiercn commented 5 years ago

@ryanbrandenburg No. I mean dotnet publish -c Release -> dotnet /bin/Release/netcoreapp2.2/publish/app.dll

ryanbrandenburg commented 5 years ago

If I do that I get:

Unhandled Exception: System.IO.FileNotFoundException: Related assembly 'Microsoft.AspNetCore.Identity.UI.Views.V3' specified by assembly 'Microsoft.AspNetCore.Identity.UI' could not be found in the directory D:\dd\Identity\test\WebSites\Identity.DefaultUI.WebSite\bin\Release\netcoreapp2.2\publish. Related assemblies must be co-located with the specifying assemblies.
   at Microsoft.AspNetCore.Mvc.ApplicationParts.RelatedAssemblyAttribute.GetRelatedAssemblies(Assembly assembly, Boolean throwOnError, Func`2 fileExists, Func`2 loadFile)
   at Microsoft.AspNetCore.Mvc.ApplicationParts.RelatedAssemblyAttribute.GetRelatedAssemblies(Assembly assembly, Boolean throwOnError)
   at Microsoft.AspNetCore.Identity.IdentityBuilderUIExtensions.<>c__DisplayClass3_0.<AddRelatedParts>b__0(ApplicationPartManager partManager) in D:\dd\Identity\src\UI\IdentityBuilderUIExtensions.cs:line 77
   at Microsoft.Extensions.DependencyInjection.MvcCoreMvcBuilderExtensions.ConfigureApplicationPartManager(IMvcBuilder builder, Action`1 setupAction)
   at Microsoft.AspNetCore.Identity.IdentityBuilderUIExtensions.AddRelatedParts(IdentityBuilder builder, UIFramework framework) in D:\dd\Identity\src\UI\IdentityBuilderUIExtensions.cs:line 132
   at Microsoft.AspNetCore.Identity.IdentityBuilderUIExtensions.AddDefaultUI(IdentityBuilder builder, UIFramework framework) in D:\dd\Identity\src\UI\IdentityBuilderUIExtensions.cs:line 54
   at Microsoft.AspNetCore.Identity.IdentityBuilderUIExtensions.AddDefaultUI(IdentityBuilder builder) in D:\dd\Identity\src\UI\IdentityBuilderUIExtensions.cs:line 33
   at Microsoft.Extensions.DependencyInjection.IdentityServiceCollectionUIExtensions.AddDefaultIdentity[TUser](IServiceCollection services, Action`1 configureOptions) in D:\dd\Identity\src\UI\IdentityServiceCollectionUIExtensions.cs:line 56
   at Microsoft.Extensions.DependencyInjection.IdentityServiceCollectionUIExtensions.AddDefaultIdentity[TUser](IServiceCollection services) in D:\dd\Identity\src\UI\IdentityServiceCollectionUIExtensions.cs:line 33
   at Identity.DefaultUI.WebSite.StartupBase`2.ConfigureServices(IServiceCollection services) in D:\dd\Identity\test\WebSites\Identity.DefaultUI.WebSite\StartupBase.cs:line 41
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
   at Identity.DefaultUI.WebSite.Program.Main(String[] args) in D:\dd\Identity\test\WebSites\Identity.DefaultUI.WebSite\Program.cs:line 16

which is a pre-existing condition because it happens on a totally clean branch.

By copying those dll's into the publish directory I found a couple instances of site.min.* remaining, which I fixed.

javiercn commented 5 years ago

@ryanbrandenburg Those issues are expected as we are referencing the assembly as a project reference and not a package and we probably didn’t fixup publish.

Have you tried both versions of the UI? (V3 and V4)

ryanbrandenburg commented 5 years ago

Fixed one extra item I found when testing in V3.

ryanbrandenburg commented 5 years ago

Is that approval then?