@liangshiwei thank you for your initial analysis. Is there any underlying explanation why this particular project is affected by it? We started a complete new project using ABP Suite 5.2 and even without the DisplayAttribute
this project is fast and responsive.
@liangshiwei, what mail address can I forward the details to? Thanks.
Hi,
We have been integrating ABP Commercial Business into our new project and so far it has been a good experience. Getting our domain and entity models added, we initially opted for using Suite to generate the UI components, but considering and realizing the more unique requirements, eventually settled on adding them manually after studying the generated code.
We opted to move these requirements to their own module where appropriate, and together with two additional modules, Metronic 8 and Multilingual, we have been able to get the authentication and dashboard integration working fine with our data models. The pages are not crazy fast, but consistent, and the 'user experience' is fine considering the current stages of development. It took some getting used to, to figure out where everything should go, especially with the localization and modules, but we feel we are at a good state none the less.
However, we came to the point where we wanted to try and figure out the 'modal' experience, which is also part of the default generated website and the pages generated with Suite. We generated the CRUD experience for 1 particular model, studied the generated code, removed what we didn't need, and added what we did need (mostly Metronic styling). The auto-generated HTTP/API and proxy classes gave an additional hurdle to fully understand the minimal requirements to get it all working together, but we did and the result was good, visually.
We decided on a more traditional approach for the models, whereas the 'index' and 'list' pages are using Knockout JS, but we are using razor pages for loading the modal content. These modals have been using the generated suite ABP tag helpers where applicable and regular (Microsoft) tag-helpers to get the desired output. We do have some script bound to provide an auto-complete experience, but it is with the form rendering where we are experiencing the first serious slowdown.
Loading the 'Create' modal of the model, that is showing your typical "Name, Address" fields takes 3-4 seconds to load. We double checked the API call and verified that it completed in 60ms, so it's not the ABP backend causing a slow-down. Since it is a Create modal, there are no additional DB queries involved, in fact we removed everything that could potentially slow it down, returning an empty new FooViewModel()
as the result, but still the dialog loaded extremely slow.
However, this did sped up the initial experience (not having to load all navigation properties, like list of companies, list of users) it did not speed up the modal loading part. We analyzed all we could think of, removing tag-helpers, removing the modal body, enabling trace logging, double-checking no EF queries are being fired. Perhaps slow scripts that could prevent the dialog from showing, but nothing explained the slow-down. We installed AppInsights, but no additional insights into what caused the slow-down. Logging output also revealed no additional information as there are simply 2-3 lines visible where it matches the route and then 3-4secs later an indication that the content is being shown.
We then started to time the entire call, which is divided as follows:
We checked with F12
in Chrome/Edge to verify that the website was waiting for the server to render the modal, we also verified this by calling just the 'create-modal' route, and that is taking almost 4 seconds to render. We then removed all form/tag helpers on the modal, and it renders in ~100ms. Then every single form field, using a tag-helper adds 200-400ms delay, and as mentioned earlier, the two dropdowns containing localized Enum values, take upwards to 500ms each.
Checking the Network tab in Chrome reveals the total load time of the modal itself:
We then added a Stopwatch on the Razor page to show the rendering times of each control:
We tried quite a lot of things to determine what could, or should not be part of the issue:
@Html.DisplayFor
and @Html.Input
, dialog takes 200ms
We've partially executed and considered the following alternative approaches:
I realize that one of your first automated replies would probably be: Can you get us an isolated MVP project to showcase the issue? Well sadly, I cannot, our project is currently the smallest application to reproduce the problem.
However, we are more than willing to:
Any help and direction at this point will be appreciated, as we simply cannot figure out why the tag-helpers and localization are causing a slowdown. Did we perhaps make a fatal configuration error with regards to modules and inheritance? Is there another option to enable diagnostic logging to figure out what the "server" is doing for ~4secs?
We've banged our heads against this wall for about a full sprint now (2 weeks) and have reached a point where we need a solution, either hopefully with the expert assistance of your team, or by reaching a different conclusion on how to proceed further.
Thank you very much for your time and effort reading this very lengthy question.
@albert
You misread my comment completely. I am showing you the before and after from using RC and then Stable. It changes the make-up of the csproj files by adding modules directly as NuGet packages instead of project references.
Adding a module to a freshly generated website using ABP Suite v5.0.0 (Stable) yields the following error:
Error occurred while adding the module "Acme.Abp.Crm" to the solution "AcmeProject"...
Could not find a class derived from AbpModule in the project '<path-to-project>/<project-name>.csproj'.
This while there is a fully functional project and the AcmeAbpModule.cs
file is located in the root of that location and is inheriting the AbpModule class, as it is a completely unmodified new project created by ABP Suite.
In addition, despite the error, the module is created in the .\modules\Acme.Abo.Crm
location, and the csproj
file is modified to load it. However, upon inspecting the file, it assumes that the project can be referenced as a NuGet package with version 5.0.0 as the assumed version?
In ABP Suite 5.0.0-rc.2
<ProjectReference Include="..\..\modules\Acme.Abp.Crm\src\Acme.Abp.Crm.Web\Acme.Abp.Crm.Web.csproj" />
In ABP Suite 5.0.0 (Stable)
<PackageReference Include="Acme.Abp.Crm.Web" Version="5.0.0" />
This breaks all the generated code in the project and logically it will not compile anymore. What am I missing here? Maybe it's time for a reboot..
Hi @albert,
After updating Suite to RC2 I get this error:
[12:00:50 ERR] Connection id "0HMDR0CIU98V0", Request id "0HMDR0CIU98V0:00000002": An unhandled exception was thrown by the application. Volo.Abp.AbpException: Could not find the bundle file '/libs/abp/core/abp.css' for the bundle 'Lepton.Global'!
Seems the wwwroot
folder is missing in the %USERPROFILE%\.dotnet\tools\.store\volo.abp.suite\5.0.0-rc.2\volo.abp.suite\5.0.0-rc.2\tools\net6.0\any
folder? When I created that folder and copied the files from the %USERPROFILE%\.dotnet\tools\.store\volo.abp.suite\5.0.0-rc.2\volo.abp.suite\5.0.0-rc.2\staticwebassets\
to that location, it started up and was usable again.
So either the staticwebassets are not being found, or the wwwroot
is missing in the publish? (assumptions)
Thanks.
maliming,
I messed up and totally forgot to edit the NuGet.config
to remove a certain detail from the feed.
Apologies for this oversight, would it be possible/required to invalidate that key and obtain a new one?
Sorry.
I have a simple project, that is roughly the same size in ZIP as our actual project, but whatever.
You can find the source here: Deleted
The application is setup to use LocalDb 2019 (came with VS2022 installer). After giving the default admin user permissions to see the module, click on the Companies menu item and you will get the error. Saving a new Company gives the same error.
Getting just this simple "clean" application to compile and start was frustration, as the generated files did not compile and some ConsoleTest project refused to build, so I removed that from the solution.
(The ctor generated for Company resulted in an illegal order of parameters in combination with nullable types, so I had to fix that manually)
I will try to reproduce this in a "barren" project, but it might very well not happen, which is exactly why I am asking troubleshooting for our actual project. There are no code samples available anywhere about creating a custom module that needs to use the User and Organization.
I'll report back if I can extract all the effort I did, not happy with this answer. Our actual project is not that much "bigger" than the starting template with 1 custom module containing half a dozen entities.