Studio 6 cannot add role and permission

I am trying to add a role and permisiion to a user with studio 6 but it never adds. I can change fields like name and it saves but never can add a role and permission. There is no error, the window closes but the role is not added.

I ran the update command with debug and this is output:

[1220/175516.201:INFO:CONSOLE(83)] "EditUserModal.submit() [object Object]", source: http://localhost:5002/bundle.js (83)
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 PUT http://localhost:5002/json/reply/SiteProxy?slug=leadinput_digitalreach_online_&request=AdminUpdateUser application/json 124
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 PUT http://localhost:5002/json/reply/SiteProxy?slug=leadinput_digitalreach_online_&request=AdminUpdateUser application/json 124 - 200 - application/json;+charset=utf-8 566.6835ms
[1220/175516.772:INFO:CONSOLE(83)] "logProxy PUT [object Object] [object Object]", source: http://localhost:5002/bundle.js (83)
[1220/175516.772:INFO:CONSOLE(83)] "handleDone Edit [object Object]", source: http://localhost:5002/bundle.js (83)
[1220/175516.772:INFO:CONSOLE(83)] "AdminUsers.search(): query,,orderBy,,skip,0,take,50", source: http://localhost:5002/bundle.js (83)
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET http://localhost:5002/json/reply/SiteInvoke?slug=leadinput_digitalreach_online_&request=AdminQueryUsers&args=query%2C%2CorderBy%2C%2Cskip%2C0%2Ctake%2C50 application/json -
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 GET http://localhost:5002/json/reply/SiteInvoke?slug=leadinput_digitalreach_online_&request=AdminQueryUsers&args=query%2C%2CorderBy%2C%2Cskip%2C0%2Ctake%2C50 application/json - - 200 - application/json;+charset=utf-8 476.4937ms
[1220/175517.251:INFO:CONSOLE(8)] "[object Object]", source: http://localhost:5002/bundle.js (8)

Any idea what is preventing roles/permission being added?

(I am not sure if it’s related but every time I start studio 6 there are no saved connections. On old version after I added a connection it would appear again when I started the app the next time. Now I have to add on every launch)

Hi @DigitalReach,

I’ve tested a few combinations with our BookingsCRUD demo app and can’t seem to reproduce the problem with roles not persisting. Are you still able to manage roles with Studio v5? What version of ServiceStack is the host you are connecting to using?

I can reproduce the problem of previously used connections not persisting after close and we’ll look to resolve.

Hi @layoric

The project is referencing:

<PackageReference Include="ServiceStack" Version="5.12.0" />

and targets:

<TargetFramework>net5.0</TargetFramework>

Local app version:

Version: 6.0.1
ServiceStack: 5.133
Framework: .NET 6.0.1
OS: Microsoft Windows NT 10.0.22000.0
Chromium: 87.0.4280.27

Studio 5 is not working for me at all (opens a white box). Here is the debug output:

app open studio --debug
ERROR: RunPreConfigure ConfigureSharpAppFeatures:
System.MissingMethodException: Method not found: 'Microsoft.AspNetCore.Hosting.IHostingEnvironment ServiceStack.NetCoreAppHostExtensions.GetHostingEnvironment(ServiceStack.IAppHost)'.
   at Studio.ConfigureSharpAppFeatures.PreConfigure(IAppHost appHost)
   at ServiceStack.ServiceStackHost.<Init>g__RunPreConfigure|40_4(Object instance) in C:\Source\Servicestack\src\ServiceStack\ServiceStackHost.cs:line 268
Application startup exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at ServiceStack.ServiceStackHost.OnStartupException(Exception ex) in C:\Source\Servicestack\src\ServiceStack\ServiceStackHost.cs:line 1040
   at ServiceStack.ServiceStackHost.OnStartupException(Exception ex, String target, String method) in C:\Source\Servicestack\src\ServiceStack\ServiceStackHost.cs:line 1049
   at ServiceStack.ServiceStackHost.<Init>g__RunPreConfigure|40_4(Object instance) in C:\Source\Servicestack\src\ServiceStack\ServiceStackHost.cs:line 272
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at ServiceStack.ServiceStackHost.Init() in C:\Source\Servicestack\src\ServiceStack\ServiceStackHost.cs:line 278
   at ServiceStack.NetCoreAppHostExtensions.UseServiceStack(IApplicationBuilder app, AppHostBase appHost) in C:\Source\Servicestack\src\ServiceStack\AppHostBase.NetCore.cs:line 406
   at Web.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env) in C:\src\dotnet-app\src\Web\Startup.cs:line 3566
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.WebHost.BuildApplication()
crit: Microsoft.AspNetCore.Hosting.Diagnostics[6]
      Application startup exception
      System.NullReferenceException: Object reference not set to an instance of an object.
         at ServiceStack.ServiceStackHost.OnStartupException(Exception ex) in C:\Source\Servicestack\src\ServiceStack\ServiceStackHost.cs:line 1040
         at ServiceStack.ServiceStackHost.OnStartupException(Exception ex, String target, String method) in C:\Source\Servicestack\src\ServiceStack\ServiceStackHost.cs:line 1049
         at ServiceStack.ServiceStackHost.<Init>g__RunPreConfigure|40_4(Object instance) in C:\Source\Servicestack\src\ServiceStack\ServiceStackHost.cs:line 272
         at System.Collections.Generic.List`1.ForEach(Action`1 action)
         at ServiceStack.ServiceStackHost.Init() in C:\Source\Servicestack\src\ServiceStack\ServiceStackHost.cs:line 278
         at ServiceStack.NetCoreAppHostExtensions.UseServiceStack(IApplicationBuilder app, AppHostBase appHost) in C:\Source\Servicestack\src\ServiceStack\AppHostBase.NetCore.cs:line 406
         at Web.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env) in C:\src\dotnet-app\src\Web\Startup.cs:line 3566
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
         at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
         at Microsoft.AspNetCore.Hosting.WebHost.BuildApplication()
[1221/012334.086:VERBOSE1:pref_proxy_config_tracker_impl.cc(186)] 0000027D4B9464A0: set chrome proxy config service to 0000027D4AF2F020
[1221/012334.095:VERBOSE1:webrtc_internals.cc(118)] Could not get the download directory.

DevTools listening on ws://127.0.0.1:20480/devtools/browser/707aa82b-563b-4847-a096-3c4abe93f297
[1221/012334.113:VERBOSE1:pref_proxy_config_tracker_impl.cc(186)] 0000027D4BA9B5A0: set chrome proxy config service to 0000027D4BA365C0

The version of your local project doesn’t matter, what matters is the version of the dotnet tool you have installed. If you have the latest v6.0 installed you need to use studio6:

$ app open studio6 --debug

I’ve updated an issue with studio6 that will load its saved site.settings properly.

If you can’t run studio6 with v6 app tool it might be related to your possible corrupted installation, can you try removing (or renaming) your .servicestack folder and try running app open studio6 again.

Hi Mythz,

My first post refers to studio 6. It will not add roles or permissions. The debug output is included in my first post. Removing the .servicestack folder did not help, behaviour persists.

No idea then, try see if debug mode sheds any more light:

app open studio6 --debug

The output of that command is in my first post

I can email the url and admin login if its helpful

The Studio UI is working as I’m able to update roles with the Blazor WASM live demo:

app://studio6?connect=https://blazor-wasm-api.jamstacks.net

User: admin@email.com / Pass: p@55wOrd

All I can think of trying is upgrading to the latest v5.13.3+ on MyGet to get the latest AdminUsersFeature implementation.

updating to 5.13.3 fixed the issue. Many thanks

2 Likes