Base solution for your next web application

Activities of "rickfrankel"

Hi All,

I'm going to document notes of frustration here on the upgrade from v12 to v13.

First thing is the change from Newtonsoft to System.Text.Json is massive and one to be very aware of.

Issue List

  1. The change to System.Text.Json breaks serialization of TimeSpan objects if you are using them in your DTO's (which we were). The long story short here is that Swashbuckle doesn't know how to handle TimeSpans correctly when using System.Text.Json refer to this link for how to make it go back to using strings for them. https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/2505

Oh boy where to start on this one. If you are storing json in the DB at all you're going to have a lot of fun. System.Text.Json doesn't use camelCase by default and our Json was all camelCase. That's easy enough to work around you can just use the JsonExtensions.CreateJsonSerializerOptions and pass in the correct parameters when you are using FromJsonString etc.

Next thing to note however is that CreateJsonSerializationOptions adds in a bunch of AbpConvertors. One of them doesn't play nicely with nullable objects. Eg: We have a nullable int. We want to also use the numberhandling options to allow for numbers to be strings. ~~ Except this doesn't work when you have a nullable int because the AbpConvertor takes over and doesn't respect the numberhandling options or attributes.~~

Ok the attribute doesn't work but the options on the seralizer do. However you need to note that the serializer options are cached and once they are setup and used once they cannot ever be changed. We had to modify our startup.cs to create the JSON serialisation options with all combinations of camelcase and write intended. Set the number handling options we want there to ensure the options were cached with our correct settings from the start.

To handle that we have to manually remove that convertor from our options after creation and then it seems to work.

  1. We were using Metronic card objects and creating them dynamically using new KTCard(#xxxx). The Metronic upgrade changes how card's work and they are now based off of Boostrap cards, which removes card.js and also removes KTCard and the way it works. We haven't found a work around yet. Will update this ticket if/when we find a workaround.
    • WORKAROUND: We were using collapsing cards which is why we needed to new KTCard them. We can use ngx-bootstrap collapse and got around this problem. Not native metronic but it works.

~~3) Scrollbars in modals seem to disappear when the modal loses focus. This is in particular to scrollbars which exist within the modal and not full pages scrollbars. We're still investigating this one.~~ This is not an issue and was our own fault.

  1. Features and redis caching and potentially other items you cache are broken. See the link in the comment below. More to come :)

Hi MightyIt,

We also had this problem (happens with lots of different hosting proxies, including cloudflare, azure app services etc).

But the file we modify is in angular\src\assets\abp-web-resources\abp.js

This file doesn't change when we upgrade any node modules to my knowledge and when we upgrade aspnetzero we're just careful on the merge to make sure it retains our value.

Rick

I believe I've had a similar issue. https://support.aspnetzero.com/QA/Questions/11843/Receiving-this-error-httpsgithubcomaspnetboilerplateaspnetboilerplateissues6755

It was related to the version of Visual Studio I was running. In particular preview versions. I believe if you want to run the latest preview version of visual studio you will need to upgrade to 13.1 (which is not yet release) which has the fixes for this in it.

However I haven't yet tested it all yet as I'm waiting for 13.1 to come up fully and not be release candidate.

Hi @oguzhanagir,

We are already running the per request cache setup. The error comes from the MiniExcelExcelExporterBase.cs line 39 where is does the _tempFileCacheManager.SetFile

If you have a large amount of data the stream.ToArray can be quite large, this can timeout the save to Redis. We had it with a grid that had around 1000 rows to export and probably 10 columns.

I also just generally don't think redis is the best choice when dealing with temporary files. It's better than the local file system (which doesn't load balance) but we are likely to update the tempfilecachemanager to use Azure Storage (which we've already got an implementation for in our binaryobjectstore.

Thanks Rick

Just to add here. I was previously running VS 17.9.0 Preview 2 and Preview 3. Both of these have the problem with the above error.

I uninstalled my Visual Studios and went back to VS 17.8.5 the stable release and it's working again now.

Something in the upcoming Visual Studios breaks the ASP Boilerplate stuff prior to version 4.1 (or Aspnet Zero anything prior to v 13).

Not sure what it is but at least I'm running again.

ERROR 2024-01-17 14:22:44,909 [9 ] nostics.DeveloperExceptionPageMiddleware - An unhandled exception has occurred while executing the request. Castle.MicroKernel.Handlers.HandlerException: Can't create component 'Microsoft.AspNetCore.Mvc.ApiExplorer.IApiDescriptionProvider_8fe94c57-4043-438a-95e5-44fb6fc328fe' as it has dependencies to be satisfied.

'Microsoft.AspNetCore.Mvc.ApiExplorer.IApiDescriptionProvider_8fe94c57-4043-438a-95e5-44fb6fc328fe' is waiting for the following dependencies:

  • Service 'Microsoft.Extensions.DependencyInjection.IServiceProviderIsService' which was not registered.

    at Castle.MicroKernel.Handlers.DefaultHandler.AssertNotWaitingForDependency() at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden) at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired) at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, Arguments additionalArguments, IReleasePolicy policy, Boolean ignoreParentContext) at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.ResolveAll(Type service, Arguments arguments, IReleasePolicy policy) at Castle.Windsor.MsDependencyInjection.MsCompatibleCollectionResolver.Resolve(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency) at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.TryResolveCore(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency, Object& value) at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.Resolve(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency) at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateConstructorArguments(ConstructorCandidate constructor, CreationContext context) at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext context) at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context) at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context, Burden burden) at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext context, Boolean trackedExternally) at Castle.MicroKernel.Lifestyle.SingletonLifestyleManager.Resolve(CreationContext context, IReleasePolicy releasePolicy) at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden) at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired) at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveFromKernelByType(CreationContext context, ComponentModel model, DependencyModel dependency) at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.TryResolveCore(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency, Object& value) at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.Resolve(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency) at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateConstructorArguments(ConstructorCandidate constructor, CreationContext context) at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext context) at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context) at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context, Burden burden) at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext context, Boolean trackedExternally) at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context, IReleasePolicy releasePolicy) at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden) at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired) at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, Arguments additionalArguments, IReleasePolicy policy, Boolean ignoreParentContext) at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, Arguments arguments, IReleasePolicy policy, Boolean ignoreParentContext) at Castle.MicroKernel.DefaultKernel.Resolve(Type service, Arguments arguments) at Castle.Windsor.MsDependencyInjection.ScopedWindsorServiceProvider.GetServiceInternal(Type serviceType, Boolean isOptional) at lambda_method3424(Closure, Object, HttpContext, IServiceProvider) at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

Hi Support Team,

Do you have any ideas what could be causing this error. https://github.com/aspnetboilerplate/aspnetboilerplate/issues/6755

I have been developing alone for a while now with no problems on version 12.4.2.

Recently something has happened to my machine and now when I try and browser to the swagger page (or run nwswag) I get the same error as linked in that article.

I could try and upgrade to version 13 which I believe is the version in which that issue is fixed. But I have others on my team using the same code as me who don't have the issue.

My guess is something related to either a windows or .net patch or update but we haven't been able to isolate it yet.

Do you have any ideas what could be causing this issue all of a sudden for me?

Thanks Rick

@ismcagdas I also had problems with this. We were looking at moving TempFileCacheManager to use our storage provider instead of using Redis. When you want to export a grid with quite a bit of data in it, the redis cache just blows up with timeouts.

We have a bunch of widgets defined for our tenant dashboard and most of them have permissionDependencies on them to control which of our tenants can see what widgets.

Our defaultTenantDashboard is configured to have all the tenant widgets available to them.

(All above setup in DashboardCustomisation.cs).

In the GetDefaultAngularTenantDashboardView() method we have setup the dashboard to include widgets that not all users will have access to. The permissions control which ones actually get displayed.

Now if a tenant tries to "Back to Default" or delete the last page on their dashboard. They will get an error if they do not have access to a particular widget that is defined in the GetDefaultAngularTenantDashboardView.

The error comes from the DashboardCustomisationAppService and in the SaveDashboardSettingForUser() method, which has been passed the GetDefaultDashboardValue from the DeletePage method.

In this case the dashboard that is passed into this method already has widgets on it that the user is not authorized to see and thus the check around allWidgetsOfDashboard.Any etc fails and we throw the UnknownWidgetId error.

Essentially because our DefaultAngularDashboard includes widgets that not all users will see in it and it is filtered out elsewhere we fail.

Could this please be looked into.

Thanks Rick

Done.

https://github.com/aspnetzero/aspnet-zero-core/issues/5043

Thanks

Showing 11 to 20 of 120 entries