Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "peteras"

Answer

Hi - yes problem was in email information. After updating account in AD with email info - user was created and all is ok

Question

My environment .net core 5.0.6 Product version v10.3.0 (angular)

I can not establish sync with AD. I did enabled LDAP using documentation. Also Module is enabled. Here is result of /TenantSettings/GetAllSettings:

    "ldap": {
      "isModuleEnabled": true,
      "isEnabled": true,
      "domain": "XXXX",
      "userName": "YYYY",
      "password": "ZZZZZ"
    },

there is no error recorded in log.

IIS is set to accept both Anonymus and win auth. Do I need to change aslo launchSettings.json? Is there any check list what needs to be done to get LDAP sync work?

I was able to detect problem. LDAP is working it is getting user information but it looks like info is not stored into user table and this is causing issues here:

var loginResult = await _logInManager.LoginAsync(usernameOrEmailAddress, password, tenancyName);
Mvc.ExceptionHandling.AbpExceptionFilter - Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Abp.Authorization.Users.AbpUser`1.SetNormalizedNames()
   at Abp.Authorization.AbpLogInManager`3.TryLoginFromExternalAuthenticationSourcesAsync(String userNameOrEmailAddress, String plainPassword, TTenant tenant)
   at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation)
   at Abp.Authorization.AbpLogInManager`3.LoginAsyncInternal(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout)
   at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation)
   at Abp.Authorization.AbpLogInManager`3.LoginAsync(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout)
   at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation)
   at MDemo.Web.Controllers.TokenAuthController.GetLoginResultAsync(String usernameOrEmailAddress, String password, String tenancyName) in Web.Core\Controllers\TokenAuthController.cs:line 753
   at MDemo.Web.Controllers.TokenAuthController.Authenticate(AuthenticateModel model) in Web.Core\Controllers\TokenAuthController.cs:line 138
   at lambda_method1709(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.&lt;InvokeNextActionFilterAsync&gt;g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.&lt;InvokeInnerFilterAsync&gt;g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.&lt;InvokeNextExceptionFilterAsync&gt;g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

Hi ismcagdas, thank you for suggestion - removing duplicates solved the problem. Thank you for your help

Hi,

after successful version update and successfull solution build I get bellow error when trying to run backend:

Abp.AbpException: A dictionary can not contain same key twice. There are some duplicated names: Price, IsActive, Value
   at Abp.Localization.Dictionaries.Xml.XmlLocalizationDictionary.BuildFomXmlString(String xmlString)
   at Abp.Localization.Dictionaries.Xml.XmlEmbeddedFileLocalizationDictionaryProvider.CreateXmlLocalizationDictionary(String xmlString)
   at Abp.Localization.Dictionaries.Xml.XmlEmbeddedFileLocalizationDictionaryProvider.InitializeDictionaries()
   at Abp.Localization.Dictionaries.LocalizationDictionaryProviderBase.Initialize(String sourceName)
   at Abp.Localization.MultiTenantLocalizationDictionaryProvider.Initialize(String sourceName)
   at Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource.Initialize(ILocalizationConfiguration configuration, IIocResolver iocResolver)
   at Abp.Localization.MultiTenantLocalizationSource.Initialize(ILocalizationConfiguration configuration, IIocResolver iocResolver)
   at Abp.Localization.LocalizationManager.InitializeSources()
   at Abp.Localization.LocalizationManager.Initialize()
   at Abp.AbpKernelModule.PostInitialize()
   at Abp.Modules.AbpModuleManager.<>c.<StartModules>b__15_2(AbpModuleInfo module)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at Abp.Modules.AbpModuleManager.StartModules()
   at Abp.AbpBootstrapper.Initialize()
   at Abp.AspNetCore.AbpApplicationBuilderExtensions.InitializeAbp(IApplicationBuilder app)
   at Abp.AspNetCore.AbpApplicationBuilderExtensions.UseAbp(IApplicationBuilder app, Action`1 optionsAction)
   at MarketShake.Web.Startup.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) in D:\WORK\MarketShake\MarketShake_migrate\aspnet-core\src\MarketShake.Web.Host\Startup\Startup.cs:line 174
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.&lt;&gt;c__DisplayClass4_0.&lt;Build&gt;b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.&lt;&gt;c__DisplayClass0_0.&lt;Configure&gt;g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Server.IIS.Core.IISServerSetupFilter.&lt;&gt;c__DisplayClass2_0.&lt;Configure&gt;b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.WebHost.StartAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String startupMessage)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String startupMessage)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)
   at MarketShake.Web.Startup.Program.Main(String[] args) in D:\WORK\MarketShake\MarketShake_migrate\aspnet-core\src\MarketShake.Web.Host\Startup\Program.cs:line 12

I can not see where the problem is. Did you noticed similar error before? Since I am using fields like "Price, IsActive, Value" in my own tables I am not sure if this is casing my part or platform part ...

To explain the steps I have taken:

  1. Using initial version (5.6) of backend and make it master
  2. creating branches from master. Branch dev, migrate, aspnetzero
  3. checkout branch migrate and copy over version (5.6) in development and make commit. tray to build and run. it works
  4. checkout branch aspnetzero and copy over latest version (8.6) and make commit. I need to resolve some problems and errors but in the end clean version update works and run
  5. Checkout branch dev and migrate it with branch migrate. resolved conflicts commit and run - it worked
  6. Migrate branch aspnetzero and dev. resolved conflicts and some errors. commit, build and run and I get mentioned error

Thank you in advance for help.

Hi,

I was able to resolve issue. I did start once again with upgrade procedure and committing every step of the way. I was able to resolve isse to create migrattion before updating database with new version's DB changes. Now all is OK.

Thank you for your help.

Hi,

I have already tried this - but "Add-Migration" creates all tables once more :(. when I was resolving conflicts I have rewrite my old snapshot file with new one. When I did test migration I saw the problem so I restore old snapshot file and problem is still present.

Hi ismcagdas thank you for quick reply. Would you be so kind and please provide more info how to do this?

Hi, I have upgraded version 5.6 to 8.6 and I have isse whe creating new migration file the platform recreates all of my existing table once more in new migration file but note that nothing changed except upgrade was done and I was testing if something was left for migration ....

Is there any way or work around that I can do to "convinced" platform that tables are already created and "add-migration" is not including them?

thank you in advanced. reP

Showing 1 to 8 of 8 entries