Base solution for your next web application

Activities of "alexanderpilhar"

Question

10.2.0, Angular

Please, also see log4net stopped generating the logs.

I think there is an issue with logging configuration!? Since ASPNETZERO 10.0.0 logging stopped to work in debug environment but was still working in production environment. Since ASPNETZERO 10.2.0 logging is working in debug environment but stopped to work in production environment.

ASPNETZERO-Team, please confirm if there is a problem.

10.1.0, Angular

Is it possible to invalidate a single item in ICacheManager? I know I can update a single item or invalidate the whole Cache - but I'm dealing with a quite complex item and can't guarantee the item will contain all information necessary for each and every case, and also I don't want to invalidate the whole Cache.

I tried setting the cached item to null but that is not allowed.

Is it possible to extend ICacheManager adding a method that invalidates a single item?

10.1.0, Angular

Have a look at Predefined Events.

What exactly is the difference between -ing and -ed events and in what scenario would I use them?

Also, see this question I posted a while ago.

I could really need an event that is called before SaveChanges() and would expect -ing events to work that way ... but, unfortunately, they don't ... anymore.

So, I wonder what is the difference between -ing and -ed events!?

9.2.1, Angular, .NET Core

Currently, I'm trying to improve client performance and came accross SubHeaderComponent. SubHeaderComponent is declared and exported by AppCommonModule, which is a shared module that declares and exports many more components.

SubHeaderComponent is a component that I use in all of my custom components and therefore I import it via shared AppCommonModule, also importing all the other components that I don't need - in most of my components SubHeaderComponent is the only component I need from AppCommonModule.

My question is: Woudn't it be better to declare and export SubHeaderComponent via a separate module, e.g. SubHeaderModule?

Let me know what you think!

9.0.1, .NET Core, Angular

The PayPal Smart Payment Buttons integration automatically offers relevant alternative payment methods based on customer's location. See: Alternative Payment Methods

They are enabled by default but need a webhook to be added to the paypal-app (PayPal Developer Dashboard). In order to add the webook I need to specify a Webhook URL - but I guess, there is no endpoint for this in ASPNETZERO yet, right!?

Without the webhook the payment process using the alternative payment method will fail, although it was offered to the customer.

Alternative payment methods can be disabled: Disable Funding

I think, ASPNETZERO maybe should implement some functionality to disable alternative payments methods via appsettings.json (similar to Stripe, where we enable PaymentMethodTypes).

Also, advice to implement the neccessary endpoint to enable alternative payment methods for PayPal would be appriciated!

9.0.1, .NET Core, Angular

When impersonating a tenant user and later switching back to host user, the following error appears in src\ProjectName.Web.Host\Startup\AuthConfigurer.cs multiple times: System.FormatException: 'The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.'

Does any one else experience this issue!?

EDIT

Here is the content of Logs.txt:

ERROR 2020-07-14 15:22:38,814 [157  ] uthentication.JwtBearer.JwtBearerHandler - Exception occurred while processing message.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
   at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
   at System.Convert.FromBase64String(String s)
   at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt, Nullable`1 keySize, Byte[] initVectorBytes)
   at CompanyName.ProjectName.Web.Startup.AuthConfigurer.SetToken(MessageReceivedContext context, Boolean allowAnonymous) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 126
   at CompanyName.ProjectName.Web.Startup.AuthConfigurer.QueryStringTokenResolver(MessageReceivedContext context) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 90
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
ERROR 2020-07-14 15:22:41,777 [119  ] uthentication.JwtBearer.JwtBearerHandler - Exception occurred while processing message.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
   at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
   at System.Convert.FromBase64String(String s)
   at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt, Nullable`1 keySize, Byte[] initVectorBytes)
   at CompanyName.ProjectName.Web.Startup.AuthConfigurer.SetToken(MessageReceivedContext context, Boolean allowAnonymous) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 126
   at CompanyName.ProjectName.Web.Startup.AuthConfigurer.QueryStringTokenResolver(MessageReceivedContext context) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 90
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
ERROR 2020-07-14 15:22:41,778 [120  ] uthentication.JwtBearer.JwtBearerHandler - Exception occurred while processing message.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
   at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
   at System.Convert.FromBase64String(String s)
   at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt, Nullable`1 keySize, Byte[] initVectorBytes)
   at CompanyName.ProjectName.Web.Startup.AuthConfigurer.SetToken(MessageReceivedContext context, Boolean allowAnonymous) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 126
   at CompanyName.ProjectName.Web.Startup.AuthConfigurer.QueryStringTokenResolver(MessageReceivedContext context) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 90
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
ERROR 2020-07-14 15:22:41,778 [64   ] uthentication.JwtBearer.JwtBearerHandler - Exception occurred while processing message.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
   at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
   at System.Convert.FromBase64String(String s)
   at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt, Nullable`1 keySize, Byte[] initVectorBytes)
   at CompanyName.ProjectName.Web.Startup.AuthConfigurer.SetToken(MessageReceivedContext context, Boolean allowAnonymous) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 126
   at CompanyName.ProjectName.Web.Startup.AuthConfigurer.QueryStringTokenResolver(MessageReceivedContext context) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 90
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
ERROR 2020-07-14 15:22:41,779 [119  ] nostics.DeveloperExceptionPageMiddleware - An unhandled exception has occurred while executing the request.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
   at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
   at System.Convert.FromBase64String(String s)
   at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt, Nullable`1 keySize, Byte[] initVectorBytes)
   at CompanyName.ProjectName.Web.Startup.AuthConfigurer.SetToken(MessageReceivedContext context, Boolean allowAnonymous) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 126
   at CompanyName.ProjectName.Web.Startup.AuthConfigurer.QueryStringTokenResolver(MessageReceivedContext context) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 90
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
   at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
ERROR 2020-07-14 15:22:41,779 [157  ] nostics.DeveloperExceptionPageMiddleware - An unhandled exception has occurred while executing the request.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
   at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
   at System.Convert.FromBase64String(String s)
   at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt, Nullable`1 keySize, Byte[] initVectorBytes)
   at CompanyName.ProjectName.Web.Startup.AuthConfigurer.SetToken(MessageReceivedContext context, Boolean allowAnonymous) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 126
   at CompanyName.ProjectName.Web.Startup.AuthConfigurer.QueryStringTokenResolver(MessageReceivedContext context) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 90
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
   at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
ERROR 2020-07-14 15:22:41,780 [120  ] nostics.DeveloperExceptionPageMiddleware - An unhandled exception has occurred while executing the request.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
   at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
   at System.Convert.FromBase64String(String s)
   at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt, Nullable`1 keySize, Byte[] initVectorBytes)
   at CompanyName.ProjectName.Web.Startup.AuthConfigurer.SetToken(MessageReceivedContext context, Boolean allowAnonymous) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 126
   at CompanyName.ProjectName.Web.Startup.AuthConfigurer.QueryStringTokenResolver(MessageReceivedContext context) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 90
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
   at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
ERROR 2020-07-14 15:22:41,780 [64   ] nostics.DeveloperExceptionPageMiddleware - An unhandled exception has occurred while executing the request.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
   at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
   at System.Convert.FromBase64String(String s)
   at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt, Nullable`1 keySize, Byte[] initVectorBytes)
   at CompanyName.ProjectName.Web.Startup.AuthConfigurer.SetToken(MessageReceivedContext context, Boolean allowAnonymous) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 126
   at CompanyName.ProjectName.Web.Startup.AuthConfigurer.QueryStringTokenResolver(MessageReceivedContext context) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 90
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
   at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

8.9.2, Angular

After updating my application from ASPNETZERO 8.8.0 to 8.9.2 the application fails to start with following content in Logs.txt in production environment:

WARN  2020-06-17 10:04:18,267 [1    ] tion.Repositories.EphemeralXmlRepository - Using an in-memory repository. Keys will not be persisted to storage.
WARN  2020-06-17 10:04:18,277 [1    ] taProtection.KeyManagement.XmlKeyManager - Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.
WARN  2020-06-17 10:04:22,237 [10   ] cy.SubscriptionExpireEmailNotifierWorker - Abp.AbpException: There is no setting defined with name: App.UiManagement.Header.DesktopFixedHeader
   at Abp.Configuration.SettingDefinitionManager.GetSettingDefinition(String name)
   at Abp.Configuration.SettingManager.ConvertSettingInfosToDictionary(List`1 settingValues)
   at Abp.Configuration.SettingManager.&lt;GetApplicationSettings&gt;b__64_0()
   at Abp.Runtime.Caching.TypedCacheExtensions.&lt;&gt;c__DisplayClass0_0`2.<Get>b__0(TKey k)
   at Abp.Runtime.Caching.TypedCacheWrapper`2.&lt;&gt;c__DisplayClass16_0.&lt;Get&gt;b__0(String k)
   at Abp.Runtime.Caching.AbpCacheBase`2.Get(TKey key, Func`2 factory)
   at Abp.Runtime.Caching.TypedCacheWrapper`2.Get(TKey key, Func`2 factory)
   at Abp.Runtime.Caching.TypedCacheExtensions.Get[TKey,TValue](ITypedCache`2 cache, TKey key, Func`1 factory)
   at Abp.Configuration.SettingManager.GetApplicationSettings()
   at Abp.Configuration.SettingManager.GetSettingValueForApplicationOrNull(String name)
   at Abp.Configuration.SettingManager.GetSettingValueInternal(String name, Nullable`1 tenantId, Nullable`1 userId, Boolean fallbackToDefault)
   at Abp.Configuration.SettingManager.GetSettingValueForApplication(String name)
   at Castle.Proxies.SettingManagerProxy.GetSettingValueForApplication_callback(String name)
   at Castle.Proxies.Invocations.ISettingManager_GetSettingValueForApplication.InvokeMethodOnTarget()
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation)
   at Castle.DynamicProxy.AsyncDeterminationInterceptor.Intercept(IInvocation invocation)
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.Proxies.SettingManagerProxy.GetSettingValueForApplication(String name)
   at CompanyName.ProjectName.MultiTenancy.SubscriptionExpireEmailNotifierWorker.DoWork()
   at Abp.Threading.BackgroundWorkers.PeriodicBackgroundWorkerBase.Timer_Elapsed(Object sender, EventArgs e)
Abp.AbpException: There is no setting defined with name: App.UiManagement.Header.DesktopFixedHeader
   at Abp.Configuration.SettingDefinitionManager.GetSettingDefinition(String name)
   at Abp.Configuration.SettingManager.ConvertSettingInfosToDictionary(List`1 settingValues)
   at Abp.Configuration.SettingManager.<GetApplicationSettings>b__64_0()
   at Abp.Runtime.Caching.TypedCacheExtensions.<>c__DisplayClass0_0`2.&lt;Get&gt;b__0(TKey k)
   at Abp.Runtime.Caching.TypedCacheWrapper`2.<>c__DisplayClass16_0.<Get>b__0(String k)
   at Abp.Runtime.Caching.AbpCacheBase`2.Get(TKey key, Func`2 factory)
   at Abp.Runtime.Caching.TypedCacheWrapper`2.Get(TKey key, Func`2 factory)
   at Abp.Runtime.Caching.TypedCacheExtensions.Get[TKey,TValue](ITypedCache`2 cache, TKey key, Func`1 factory)
   at Abp.Configuration.SettingManager.GetApplicationSettings()
   at Abp.Configuration.SettingManager.GetSettingValueForApplicationOrNull(String name)
   at Abp.Configuration.SettingManager.GetSettingValueInternal(String name, Nullable`1 tenantId, Nullable`1 userId, Boolean fallbackToDefault)
   at Abp.Configuration.SettingManager.GetSettingValueForApplication(String name)
   at Castle.Proxies.SettingManagerProxy.GetSettingValueForApplication_callback(String name)
   at Castle.Proxies.Invocations.ISettingManager_GetSettingValueForApplication.InvokeMethodOnTarget()
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation)
   at Castle.DynamicProxy.AsyncDeterminationInterceptor.Intercept(IInvocation invocation)
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.Proxies.SettingManagerProxy.GetSettingValueForApplication(String name)
   at CompanyName.ProjectName.MultiTenancy.SubscriptionExpireEmailNotifierWorker.DoWork()
   at Abp.Threading.BackgroundWorkers.PeriodicBackgroundWorkerBase.Timer_Elapsed(Object sender, EventArgs e)
FATAL 2020-06-17 10:04:22,360 [1    ] Microsoft.AspNetCore.Hosting.WebHost     - Application startup exception
Abp.AbpException: There is no setting defined with name: App.UiManagement.Header.DesktopFixedHeader
   at Abp.Configuration.SettingDefinitionManager.GetSettingDefinition(String name)
   at Abp.Configuration.SettingManager.ConvertSettingInfosToDictionary(List`1 settingValues)
   at Abp.Configuration.SettingManager.&lt;GetApplicationSettings&gt;b__64_0()
   at Abp.Runtime.Caching.TypedCacheExtensions.&lt;&gt;c__DisplayClass0_0`2.<Get>b__0(TKey k)
   at Abp.Runtime.Caching.TypedCacheWrapper`2.&lt;&gt;c__DisplayClass16_0.&lt;Get&gt;b__0(String k)
   at Abp.Runtime.Caching.AbpCacheBase`2.Get(TKey key, Func`2 factory)
   at Abp.Runtime.Caching.TypedCacheWrapper`2.Get(TKey key, Func`2 factory)
   at Abp.Runtime.Caching.TypedCacheExtensions.Get[TKey,TValue](ITypedCache`2 cache, TKey key, Func`1 factory)
   at Abp.Configuration.SettingManager.GetApplicationSettings()
   at Abp.Configuration.SettingManager.GetSettingValueForApplicationOrNull(String name)
   at Abp.Configuration.SettingManager.GetSettingValueInternal(String name, Nullable`1 tenantId, Nullable`1 userId, Boolean fallbackToDefault)
   at Abp.Configuration.SettingManager.GetSettingValueForApplication(String name)
   at Castle.Proxies.SettingManagerProxy.GetSettingValueForApplication_callback(String name)
   at Castle.Proxies.Invocations.ISettingManager_GetSettingValueForApplication.InvokeMethodOnTarget()
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation)
   at Castle.DynamicProxy.AsyncDeterminationInterceptor.Intercept(IInvocation invocation)
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.Proxies.SettingManagerProxy.GetSettingValueForApplication(String name)
   at Abp.Localization.ApplicationLanguageManager.GetDefaultLanguageOrNull(Nullable`1 tenantId)
   at Castle.Proxies.ApplicationLanguageManagerProxy.GetDefaultLanguageOrNull_callback(Nullable`1 tenantId)
   at Castle.Proxies.Invocations.ApplicationLanguageManager_GetDefaultLanguageOrNull.InvokeMethodOnTarget()
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation)
   at Castle.DynamicProxy.AsyncDeterminationInterceptor.Intercept(IInvocation invocation)
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.Proxies.ApplicationLanguageManagerProxy.GetDefaultLanguageOrNull(Nullable`1 tenantId)
   at Abp.Localization.ApplicationLanguageProvider.SetDefaultLanguage(List`1 languageInfos)
   at Abp.Localization.ApplicationLanguageProvider.GetActiveLanguages()
   at Abp.Localization.LanguageManager.GetActiveLanguages()
   at Abp.AspNetCore.AbpApplicationBuilderExtensions.UseAbpRequestLocalization(IApplicationBuilder app, Action`1 optionsAction)
   at CompanyName.ProjectName.Web.Startup.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\Startup.cs:line 219
   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.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter.<>c__DisplayClass4_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.WebHost.BuildApplication()
WARN  2020-06-17 10:04:22,374 [1    ] taProtection.KeyManagement.XmlKeyManager - No XML encryptor configured. Key {c121703a-69de-4b7a-89dd-6afb1aac3bf3} may be persisted to storage in unencrypted form.
ERROR 2020-06-17 10:04:22,624 [8    ] Microsoft.AspNetCore.Server.Kestrel      - Connection id "0HM0IIK5OCR3M", Request id "0HM0IIK5OCR3M:00000001": An unhandled exception was thrown by the application.
System.OverflowException: Arithmetic operation resulted in an overflow.
   at System.IO.StreamWriter.Write(String value)
   at Microsoft.AspNetCore.Hosting.Views.ErrorPage.ExecuteAsync()
   at Microsoft.Extensions.RazorViews.BaseView.ExecuteAsync(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
ERROR 2020-06-17 10:04:22,624 [4    ] Microsoft.AspNetCore.Server.Kestrel      - Connection id "0HM0IIK5OCR3O", Request id "0HM0IIK5OCR3O:00000001": An unhandled exception was thrown by the application.
System.OverflowException: Arithmetic operation resulted in an overflow.
   at System.IO.StreamWriter.Write(String value)
   at Microsoft.AspNetCore.Hosting.Views.ErrorPage.ExecuteAsync()
   at Microsoft.Extensions.RazorViews.BaseView.ExecuteAsync(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
ERROR 2020-06-17 10:04:22,624 [9    ] Microsoft.AspNetCore.Server.Kestrel      - Connection id "0HM0IIK5OCR3N", Request id "0HM0IIK5OCR3N:00000001": An unhandled exception was thrown by the application.
System.ArgumentOutOfRangeException: Index and count must refer to a location within the buffer. (Parameter 'chars')
   at System.Text.EncoderNLS.GetBytes(Char[] chars, Int32 charIndex, Int32 charCount, Byte[] bytes, Int32 byteIndex, Boolean flush)
   at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
   at System.IO.StreamWriter.Write(String value)
   at Microsoft.AspNetCore.Hosting.Views.ErrorPage.ExecuteAsync()
   at Microsoft.Extensions.RazorViews.BaseView.ExecuteAsync(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
ERROR 2020-06-17 10:04:22,624 [7    ] Microsoft.AspNetCore.Server.Kestrel      - Connection id "0HM0IIK5OCR3P", Request id "0HM0IIK5OCR3P:00000001": An unhandled exception was thrown by the application.
System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
   at System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
   at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
   at System.IO.StreamWriter.Write(String value)
   at Microsoft.AspNetCore.Hosting.Views.ErrorPage.ExecuteAsync()
   at Microsoft.Extensions.RazorViews.BaseView.ExecuteAsync(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
ERROR 2020-06-17 10:04:22,661 [4    ] Microsoft.AspNetCore.Server.Kestrel      - Connection id "0HM0IIK5OCR3R", Request id "0HM0IIK5OCR3R:00000001": An unhandled exception was thrown by the application.
System.OverflowException: Arithmetic operation resulted in an overflow.
   at System.IO.StreamWriter.Write(String value)
   at Microsoft.AspNetCore.Hosting.Views.ErrorPage.ExecuteAsync()
   at Microsoft.Extensions.RazorViews.BaseView.ExecuteAsync(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
ERROR 2020-06-17 10:04:22,661 [7    ] Microsoft.AspNetCore.Server.Kestrel      - Connection id "0HM0IIK5OCR3Q", Request id "0HM0IIK5OCR3Q:00000001": An unhandled exception was thrown by the application.
System.OverflowException: Arithmetic operation resulted in an overflow.
   at System.IO.StreamWriter.Write(String value)
   at Microsoft.AspNetCore.Hosting.Views.ErrorPage.ExecuteAsync()
   at Microsoft.Extensions.RazorViews.BaseView.ExecuteAsync(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

This problem does not occur in development environment.

Please advice!

8.7.0, Core, Angular

In Web.Host\Startup\Startup.cs we can see the following line: services.AddSignalR(options => { options.EnableDetailedErrors = true; });

This is what Microsoft Docs say about EnableDetailedErrors:

If true, detailed exception messages are returned to clients when an exception is thrown in a Hub method. The default is false, as these exception messages can contain sensitive information.

So, you might not want to have EnableDetailedErrors turned on in an production environment. I guess, this might have been forgotten to be disabled after debugging some SignalR stuff?

8.2.1, Angular, .Net Core

This is a general question about selling a product / service built with ASPNETZERO and the implications when it comes to invoicing and taxation / taxing.

Let's assume the following:

  • company's home is a country in the European Union (EU)
  • product / service will be available international
  • product / service will be available for B2B and B2C

Invoicing and taxation / taxing is depending on:

  • Where the tenant is from (same country / member of the EU / outside EU)
  • The type of tenant (B2B / B2C)

As far as I see, there is no built-in way in ASPNETZERO to handle this scenario yet. So, how do you do it?

8.2.1, Angular, .Net Core

Sometimes, when impersonating as a tenant user, an exception is thrown (...pZeroTemplate.Web.Core/Authentication/JwtBearer/AbpZeroTemplateJwtSecurityTokenHandler.cs):

Log.txt:

ERROR 2020-02-28 14:19:06,679 [44   ] Mvc.ExceptionHandling.AbpExceptionFilter - A task was canceled.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
   at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase`3.FirstOrDefaultAsync(TPrimaryKey id)
   at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation)
   at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation)
   at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation)
   at CompanyName.ProjectName.Authorization.Users.UserManager.GetUserOrNullAsync(UserIdentifier userIdentifier) in D:\UserName\source\repos\CompanyName.ProjectName.Core\src\CompanyName.ProjectName.Core\Authorization\Users\UserManager.cs:line 84
   at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation)
   at CompanyName.ProjectName.Authorization.Users.UserManager.GetUserAsync(UserIdentifier userIdentifier) in D:\UserName\source\repos\CompanyName.ProjectName.Core\src\CompanyName.ProjectName.Core\Authorization\Users\UserManager.cs:line 95
   at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException[TResult](Task`1 task)
   at Nito.AsyncEx.AsyncContext.<>c__DisplayClass16_0`1.&lt;Run&gt;b__0(Task`1 t)
   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
   at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException[TResult](Task`1 task)
   at Nito.AsyncEx.AsyncContext.Run[TResult](Func`1 action)
   at Abp.Threading.AsyncHelper.RunSync[TResult](Func`1 func)
   at CompanyName.ProjectName.Authorization.Users.UserManager.GetUser(UserIdentifier userIdentifier) in D:\UserName\source\repos\CompanyName.ProjectName.Core\src\CompanyName.ProjectName.Core\Authorization\Users\UserManager.cs:line 106
   at CompanyName.ProjectName.Web.Controllers.TokenAuthController.LogOut() in D:\UserName\source\repos\CompanyName.ProjectName.Core\src\CompanyName.ProjectName.Web.Core\Controllers\TokenAuthController.cs:line 268
   at lambda_method(Closure , Object )
   at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableResultExecutor.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)


Further information:

  • I'm experiencing this issue since version 8.2.1 (upgraded from 8.1.0) in my development environment (did not try in production yet).
  • Sometimes, it also occurs when switching back from tenant user account to host user account.
  • It usually only occurs on first time impersonating a specific tenant user, after that there is no problem anymore until i completely restart the application.

Can anybody confirm this behaviour?

EDIT


I did also implement changes according to remove unused codes but it did not change the behaviour.

Showing 11 to 20 of 51 entries