Possible compatibility issue between RS and RBS in the security layer

Hi,

There is any known compatibility issue between RS and RBS in the security layer?

I'm trying to move the all development processes to RBS. But sometimes I need to test something in RS.

In my last test, I got the following error.

  1. Code was running on RBS.
  2. I tried to run the same code in RS but the errors are generated. (without any change)
  3. I retried to run in RBS.
    • Errors didn't change.
  4. The security layer is regenerated in RS.
    • Errors didn't change.
  5. The security layer is regenerated in RBS.
    • Errors cleared.

Not tested : The files that are in the error message were not added to ignore list. This option is not tested.

dotnet: C:\Users\Administrator\source\repos\Valura_v2\server\Controllers\ApplicationUsersController.cs(94,22): error CS1061: 'ApplicationUser' does not contain a definition for 'Roles' and no accessible extension method 'Roles' accepting a first argument of type 'ApplicationUser' could be found (are you missing a using directive or an assembly reference?) [C:\Users\Administrator\source\repos\Valura_v2\server\ValuraMasterApplication.csproj]

dotnet: C:\Users\Administrator\source\repos\Valura_v2\server\Controllers\ApplicationUsersController.cs(102,75): error CS1061: 'ApplicationUser' does not contain a definition for 'Roles' and no accessible extension method 'Roles' accepting a first argument of type 'ApplicationUser' could be found (are you missing a using directive or an assembly reference?) [C:\Users\Administrator\source\repos\Valura_v2\server\ValuraMasterApplication.csproj]
C:\Users\Administrator\source\repos\Valura_v2\server\Controllers\ApplicationUsersController.cs(136,42): error CS1061: 'ApplicationUser' does not contain a definition for 'Roles' and no accessible extension method 'Roles' accepting a first argument of type 'ApplicationUser' could be found (are you missing a using directive or an assembly reference?) [C:\Users\Administrator\source\repos\Valura_v2\server\ValuraMasterApplication.csproj]
C:\Users\Administrator\source\repos\Valura_v2\server\Controllers\ApplicationUsersController.cs(138,71): error CS1061: 'ApplicationUser' does not contain a definition for 'Roles' and no accessible extension method 'Roles' accepting a first argument of type 'ApplicationUser' could be found (are you missing a using directive or an assembly reference?) [C:\Users\Administrator\source\repos\Valura_v2\server\ValuraMasterApplication.csproj]
C:\Users\Administrator\source\repos\Valura_v2\server\Services\ApplicationAuthenticationStateProvider.cs(42,51): error CS1503: Argument 1: cannot convert from 'Microsoft.AspNetCore.Components.Authorization.AuthenticationState' to 'Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider' [C:\Users\Administrator\source\repos\Valura_v2\server\ValuraMasterApplication.csproj]
C:\Users\Administrator\source\repos\Valura_v2\server\Services\ApplicationAuthenticationStateProvider.cs(51,61): error CS1061: 'SecurityService' does not contain a definition for 'GetAuthenticationStateAsync' and no accessible extension method 'GetAuthenticationStateAsync' accepting a first argument of type 'SecurityService' could be found (are you missing a using directive or an assembly reference?) [C:\Users\Administrator\source\repos\Valura_v2\server\ValuraMasterApplication.csproj]

I think that this is about my configuration, though I wanted to let you know.

A notice about the issue.

  • I generally separate the database connections as data-connection and security-connection even if they are in the same database. In this case I've two separate connections for the same database with different table sets.

Yes, RBS generates different security code. After that running the app from RS would make it generate the older security code (with a mix of new code from RBS which RS does not know about). Things won't work for sure. We have documented some of the differences here.

If you decide to use RBS security but still need to run the app from RS add the security files to RS code generation ignore list so it doesn't change them. You still may need to add Security again from RBS though as some methods which RS generates are not needed (InitializeAsync). Probably it would be best to just remove security from RS (set it to None) and then add it in RBS.

Is it possible to remove the Security layer on RBS like RS? The developer can select "none" in RS to remove the security layer. But I can't find any option like this on the RBS.

Similarly, Data connections have a trashcan icon to remove the connection in RS but no remove option on RBS.

No. Radzen Blazor Studio does not remove code as it isn't very clear what code is generated by it and what is user code.

Same.

I'm sorry but this approach is mostly close to Boilerplate Code generation instead of a RAD tool for me. It was created and forgotten.

You can define some restrictions such as untouchable files or something like that. This part could be RBS's untouchable kingdom (if this means using metafiles maybe you need to think again about using them). Developers can use partial class power to write their own codes. This type of coding feels comfortable and safe. This also helps inexperienced developers.

Of course, it's impossible to know all of your future perspectives on the RBS. But I believe that you have to keep some RS goodies.

For example, when I refresh the database structure RS knows what I want. Which tables are already selected by me, which views or stored procedures are wanted and RS can show me which fields are new. This is an awesome feature. But in RBS I must select everything from scratch every time. This is not good if you are using a part of the shared database.

I'm waiting for more, as a customer who has used RS. Customers don't want less if you gave them more before.

RBS is still on its way to being a very good development environment. As I said, I don't know your perspective and maybe I expect more than you planned because of feeling the RBS potential.

I have to underline that, I respect what you are doing so much and I know this is very difficult work. Please don't think my criticisms are too harsh. I share my thoughts with you to be a contributor to a leading development environment.

Thanks.

The main goal of Radzen Blazor Studio is to not rely on meta file, locked code sections or rewriting modified files. So we don't plan to add anything like that.

Adding and removing security isn't something people do that often. RS can do it because it generates the code on every run of the application. If you had partial files that used security and you remove it - you got a build error. The same goes for removing databases - any custom code becomes a compilation error.

This is something that we will add to RBS at some point. Let us know if there are other parts from RS that you find missing (apart from ones relying on RS's concept of metadata based code generation).

I disagree that it helps inexperienced developers. It teaches them something specific to a tool (using locked files) which they can't reuse anywhere else.