Base solution for your next web application

Activities of "[email protected]"

Trying to create a new module and trying to figure out the best practice for configuring the module from appsettings values.

I have read this link. https://aspnetboilerplate.com/Pages/Documents/Startup-Configuration. I have setup my module like that but can't figure out where to initialize the configuration values. Should I put my dependson in the core module? If so, I don't have the appsettings there.
Should I put the dependson in the webcore module? The problem is the order is off since the PreInitialize of my custom module gets called first. Or finally, should the dependson go in the webhost module?

This custom module is to introduce Elasticsearch into the project. I will need to fire a create index on startup so I need the configuration values.

Thanks

Answer

Really surprised nobody else has noticed this issue. But PrimeNG themes introduced @layers with version 16.4. The problem is Metronic and everything else does not use layers. So, what ends up happening is that PrimeNG styles don't get top priority anymore, so you get weird behavior.

Here is a link to the issue.

https://github.com/primefaces/primeng/issues/13757

The fix I have found is to copy the PrimeNG theme css files you need into your assets folder and edit them to remove the @layers lines. Then change angular.json to use those files instead of the ones from node_modules.

Actually, I found the issue.

In angular.json, you guys define two projects.

abp-zero-template and abp-zero-template-e2e

So, it makes sense now that the defaultProject is not being defined it does not know which project to choose when creating components. So now you must pass the flag --project to tell the cli which project to use. I don't see where that second project is being used anymore. If it's for protactor, that is deprecated so maybe that can be removed?

Protractor is deprecated and will reach end-of-life in August 2023.

Some more updates to this.

Yes using the --project parameter works. But this is supposed to be optional.

I tried a blank Angular application created using the CLI and in there the ng g c works fine. The also don't have the defaultProject field in the angular.json.

I am doing so comparing to see what is different in the rest of the file.

I seem to lost the ability to use the Angular CLi to generate a component.

ng g c test-modal-component

Gives the error that the project missing.

Data path "" must have required property 'project'.

What I noticed is the removal of "defaultProject": "abp-zero-template" since it was deprecated and Angular update, I am sure removed it. I can add the --project to the cli call and it works. Was trying to see if anyone else find why the default project name is not being resolved.

I am trying to get to get an additional value from the token and can't seem to understand how to get the additional values using the code above.

I can do this in TokenAuthController but it seems like a hack.

        var handler = new JwtSecurityTokenHandler();
        var jwtSecurityToken = handler.ReadJwtToken(model.ProviderAccessCode);
        var oidValue = jwtSecurityToken.Claims.First(claim => claim.Type == "oid").Value;
Question

What happened to the aot compile option in angular.json? I know I can add it back, but was there a reason it got removed?

I have a stie deployed to Azure. It's been working fine for the past few months, but after this latest update appsettings.production.json seems to not be working. It seems to always drop back to just appsettings.json.

I have ASPNETCORE_ENVIRONMENT set to Production.

Any ideas?

I will save you the trouble of what I have already researched, ASP.Net Zero loosley uses Metronic theme. They build their own layout and structure and then apply Metronic styles to it. It gets really difficult to try to use things on Metronic because of this. Not how I would have built a general framework, but that is how they did it.

Showing 1 to 9 of 9 entries