It's for a demonstration, you can create a new project with your favorite project template such as app-pro
in this case. and make a comparison of what should be changed. Configuring a Blazor Server from zero is really complicated and might be buggy. So, create a new blazor-server project and compare changes.
Or, you can move your existing pages to the newly created blazor-server project instead of modifying the old one. After moving the files, you can remove the old project. That is a different way but you can lose your git history
Blazor WASM is a client-side application and entire code is shipped to browsers. So it can't connect to database directly and it requires a HTTP backend application, in that case it's your HttpApi.Host project.
But Blazor Server is a typical AspNetCore web application and performs blazor actions with websocket. So, this AspNetCore application can connect database directly, it can work without HTTP API, because itself is a server-side application.
If you want to still use your HttpApi.Host as a backend service with blazor-server, you have to create a new project with --tiered
parameter and compare differences with your existing project. But if you want to unify your backend application and blazor in a single Blazor Server application, you can just create a regular blazor server application and compare it with your existing application to see differences.
(abp new MyProjectName -u blazor-server
: This command creates a unified blazor server project without an extra HttpApi.Host
project.
abp new MyProjectName -u blazor-server --tiered
: This command creates a blazor server and HttpApi.Host project together and that blazor project sends requests to HTTP API instead of directly connecting database.
It depends which project type are you using. Is your blazor-server will connect directly database or make requests to you existing HttpApi.Host?
Best way to change it to blazor server is creating new project and compare changes like I did in this PR: https://github.com/enisn/abp-blazor-wasm-to-server/pull/1
If your new blazor-server will send requests to HttpApi.Host like exactly same with current webassembly, you can create the project with --tiered
parameter.
But you should customize files to watch in .csproj
file for including js files according to Microsoft's docs: Customize files list to watch
<ItemGroup>
<!-- extends watching group to include *.js files -->
<Watch Include="**\*.js" Exclude="node_modules\**\*;**\*.js.map;obj\**\*;bin\**\*" />
</ItemGroup>
Hi @developer_infoline
Have you tried to run your project with dotnet watch run
. The watch should watch changes on the rest of the files like css too.
https://docs.microsoft.com/en-us/aspnet/core/tutorials/dotnet-watch?view=aspnetcore-6.0#run-net-core-cli-commands-using-dotnet-watch
dotnet watch refreshes the browser when it detects changes to watched files. To do this, the watch command injects a middleware to the app that modifies HTML responses created by the app. The middleware adds a JavaScript script block to the page that allows dotnet watch to instruct the browser to refresh. Currently, changes to all watched files, including static content such as .html and .css files cause the app to be rebuilt.
Hi @FrancoisLabelle
Your pipeline should restore client libraries too before or after the build and so you can include the libs
folder in your docker image too.
I don't understand what you mean by "clean/vanilla server". As I understand you don't dockerize your application and trying to deploy DLLs only? Like IIS deployment. If yes, you can still restore client libraries in your pipeline. It should be a part of your build step. It should be easy to add a new step to the pipeline in each modern DevOps tool.
Remove the .gitignore exclusion and push the libs folder to my source file repository ?
But if you prefer, you can include the libs
folder in your git. One of the reasons for removing them is their size. But in a single project, you can choose to keep them in git.
Unfortunately, there is no mention of it in this documentation: https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/additional-scenarios?view=aspnetcore-6.0
We (as ABP Framework) don't implement directly this flow. It's implemented by Microsoft, you may ask them about it. There may be an internal API or something else but I don't think so. Because that component performs the functionality, if you can achieve to remove it, the logout functionality won't be performed at the end.
Hi @trina.thompson
The problem occurs because abp CLI tries to install LeptonX Beta.1 version, but beta.1 is only compatible with ABP 5.2
We're working on this issue. You can add the following dependency into your Web.csproj file manually for now.
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX" Version="1.0.0-beta.2" />```
Hi @lalitChougule
appsettings is not a part of ABP Framework. It's part of Microsoft.Extensions.Configuration namespace. So I'm not sure what is the best way to move configurations to database but there is an example about what you exactly want: https://stackoverflow.com/questions/60330342/can-i-move-configuration-from-appsettings-json-to-database-in-an-asp-net-core-mv
Hi @deepak
We designed permissions to be kept in a Dictionary. Unfortunately dictionaries in C# aren't designed for being able to be sorted. https://stackoverflow.com/a/7521383/7200126
We can consider adding an order to permissions but currently, there is no order in permission groups.
I can show you a workaround until we'll add that feature.
YourProjectNamePermissionDefinitionProvider
in .Application.Contracts project and make a manual ordering like below.public override void Define(IPermissionDefinitionContext context)
{
// some other permission additions of your app
// ...
if (context is PermissionDefinitionContext definitionContext)
{
var ordered = definitionContext.Groups.OrderByDescending(...).ToList();
definitionContext.Groups.Clear();
foreach (var item in ordered)
{
definitionContext.Groups.Add(item.Key, item.Value);
}
}
}