Dash board page does not display, generating and exception, using Single File hosting method

Using the single file hosting method, I’m consistently unable to display / load a Page with the logs showing an unhandled exception and the page simply does not render.

I’m deploying Universal by extracting it from the ZIP file into a folder location (on Windows).

$CodeRoot = $PSScriptRoot

# Single File Configuration for development...

[System.Reflection.Assembly]::LoadFrom("${CodeRoot}\Modules\Universal\Cmdlets\Newtonsoft.Json.dll")

Import-Module "${CodeRoot}\Modules\Universal"

New-Item -Path "${CodeRoot}\UA" -ItemType Directory -ErrorAction SilentlyContinue

New-Item -Path "${CodeRoot}\UA\logs" -ItemType Directory -ErrorAction SilentlyContinue

$env:Data__RepositoryPath = "${CodeRoot}\UA\Repository"

$env:Data__ConnectionString = "filename=${CodeRoot}\UA\database.db;upgrade=true"

$env:Logging_Path = "${CodeRoot}\UA\log.txt"

$env:Logging_LogLevel_Default = "Warning"

$env:CorsHosts = "http://localhost:8080;http://$($env:COMPUTERNAME.ToLower()):8080;http://$($env:COMPUTERNAME.ToLower()).$($env:USERDNSDOMAIN.ToLower()):8080"

$env:UniversalDashboard__AssetsFolder = "${CodeRoot}\UA\Assets\Dashboard"

# Get the Powershell Version

$PSUEnvironment = powershell.exe -Command '$PSVersionTable.PSVersion.ToString()'

Start-PSUServer -Port 8080 -Configuration {

    New-PSUEnvironment -Name $PSUEnvironment -Path (Get-Command -Name "powershell.exe").Source -PSModulePath "${CodeRoot}\Modules" -Modules @("PSSQlite","ImportExcel","ActiveDirectory")

    Set-PSUSetting -LoggingFilePath "${CodeRoot}\UA\logs\log.txt" -LogLevel "Warning" -Telemetry -DisableAutoReload -DisableUpdateCheck -DefaultEnvironment $PSUEnvironment -SecurityEnvironment $PSUEnvironment -ApiEnvironment $PSUEnvironment -DefaultPage "dashboards"

    New-PSUDashboard -Name 'Dashboard' -BaseUrl '/dashboard' -Environment $PSUEnvironment -Framework 'UniversalDashboard:Latest' -Content {

        New-UDDashboard -Title 'Hello, World' -Content {

            New-UDForm -Content {

                New-UDTextbox -Label 'Say Hi' -Id 'textbox'

            } -OnSubmit {

                Show-UDToast -Message $EventData.textbox

            }

        }

    }

}

Log output:

2021-07-28T17:03:58.9348701+02:00 0HMAHR34LLGHA:00000017 [INF] Request starting HTTP/1.1 GET http://localhost:8080/api/internal/component/element/210ce75b-1fbc-4af8-aa4a-47bb8963994a? - - (ca22a1cb)
2021-07-28T17:03:58.9376065+02:00 0HMAHR34LLGHA:00000017 [INF] Executing endpoint '"UniversalDashboard.Controllers.ComponentController.Element (Universal.Server)"' (500cc934)
2021-07-28T17:03:58.9397901+02:00 0HMAHR34LLGHA:00000017 [INF] Route matched with "{action = \"Element\", controller = \"Component\"}". Executing controller action with signature "System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.IActionResult] Element(System.String)" on controller "UniversalDashboard.Controllers.ComponentController" ("Universal.Server"). (122b2fdf)
2021-07-28T17:03:58.9627215+02:00 0HMAHR34LLGHA:00000017 [INF] Executed action "UniversalDashboard.Controllers.ComponentController.Element (Universal.Server)" in 22.8656ms (afa2e885)
2021-07-28T17:03:58.9632836+02:00 0HMAHR34LLGHA:00000017 [INF] Executed endpoint '"UniversalDashboard.Controllers.ComponentController.Element (Universal.Server)"' (99874f2b)
2021-07-28T17:03:59.0689708+02:00 0HMAHR34LLGHA:00000017 [ERR] An unhandled exception has occurred while executing the request. (48a46595)
System.ArgumentNullException: Value cannot be null. (Parameter 'value')
   at Google.Protobuf.ProtoPreconditions.CheckNotNull[T](T value, String name)
   at UniversalDashboardProtocol.executeEndpointParameter.set_Value(String value) in D:\a\universal\universal\src\Protocol\obj\Release\netstandard2.0\protos\Dashboard.cs:line 1801
   at Universal.Server.Services.DashboardProxy.ExecuteAsync(ExecutionContext context) in D:\a\universal\universal\src\Universal.Server\Services\DashboardProxy.cs:line 468
   at UniversalDashboard.Controllers.ComponentController.RunScript(String endpointId, Dictionary`2 parameters) in D:\a\universal\universal\src\Universal.Server\Controllers\ComponentController.cs:line 137
   at UniversalDashboard.Controllers.ComponentController.Element(String id) in D:\a\universal\universal\src\Universal.Server\Controllers\ComponentController.cs:line 193
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Universal.Server.Middleware.RoutingMiddleware.Invoke(HttpContext httpContext, IPolicyEvaluator policyEvaluator) in D:\a\universal\universal\src\Universal.Server\Middleware\RoutingMiddleware.cs:line 113
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at AspNetCoreRateLimit.RateLimitMiddleware`1.Invoke(HttpContext context) in D:\a\universal\universal\src\AspNetCoreRateLimit\Middleware\RateLimitMiddleware.cs:line 109
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
2021-07-28T17:03:59.0707996+02:00 0HMAHR34LLGHA:00000017 [WRN] No exception handler was found, rethrowing original exception. (61fc7fab)
2021-07-28T17:03:59.0909801+02:00 0HMAHR34LLGHA:00000017 [ERR] Connection id ""0HMAHR34LLGHA"", Request id ""0HMAHR34LLGHA:00000017"": An unhandled exception was thrown by the application. (560e7d32)
System.ArgumentNullException: Value cannot be null. (Parameter 'value')
   at Google.Protobuf.ProtoPreconditions.CheckNotNull[T](T value, String name)
   at UniversalDashboardProtocol.executeEndpointParameter.set_Value(String value) in D:\a\universal\universal\src\Protocol\obj\Release\netstandard2.0\protos\Dashboard.cs:line 1801
   at Universal.Server.Services.DashboardProxy.ExecuteAsync(ExecutionContext context) in D:\a\universal\universal\src\Universal.Server\Services\DashboardProxy.cs:line 468
   at UniversalDashboard.Controllers.ComponentController.RunScript(String endpointId, Dictionary`2 parameters) in D:\a\universal\universal\src\Universal.Server\Controllers\ComponentController.cs:line 137
   at UniversalDashboard.Controllers.ComponentController.Element(String id) in D:\a\universal\universal\src\Universal.Server\Controllers\ComponentController.cs:line 193
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Universal.Server.Middleware.RoutingMiddleware.Invoke(HttpContext httpContext, IPolicyEvaluator policyEvaluator) in D:\a\universal\universal\src\Universal.Server\Middleware\RoutingMiddleware.cs:line 113
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at AspNetCoreRateLimit.RateLimitMiddleware`1.Invoke(HttpContext context) in D:\a\universal\universal\src\AspNetCoreRateLimit\Middleware\RateLimitMiddleware.cs:line 109
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.HandleException(HttpContext context, ExceptionDispatchInfo edi)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
2021-07-28T17:03:59.0911736+02:00 0HMAHR34LLGHA:00000017 [INF] Request finished HTTP/1.1 GET http://localhost:8080/api/internal/component/element/210ce75b-1fbc-4af8-aa4a-47bb8963994a? - - - 500 0 - 156.3105ms (791a596a)
2021-07-28T17:04:03.8094325+02:00 0HMAHR34LLGHA:00000018 [INF] Request starting HTTP/1.1 GET http://localhost:8080/api/internal/session/bb32b3ac-7c65-49e0-912c-9e5cf53099a2 - - (ca22a1cb)
2021-07-28T17:04:03.8108944+02:00 0HMAHR34LLGHA:00000018 [INF] Executing endpoint '"UniversalDashboard.Controllers.SessionController.Index (Universal.Server)"' (500cc934)
2021-07-28T17:04:03.8146342+02:00 0HMAHR34LLGHA:00000018 [INF] Route matched with "{action = \"Index\", controller = \"Session\"}". Executing controller action with signature "System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.IActionResult] Index(System.String)" on controller "UniversalDashboard.Controllers.SessionController" ("Universal.Server"). (122b2fdf)
2021-07-28T17:04:03.8286034+02:00 0HMAHR34LLGHA:00000018 [INF] Executing HttpStatusCodeResult, setting HTTP status code 200 (e28ccfae)
2021-07-28T17:04:03.8286925+02:00 0HMAHR34LLGHA:00000018 [INF] Executed action "UniversalDashboard.Controllers.SessionController.Index (Universal.Server)" in 14.0206ms (afa2e885)
2021-07-28T17:04:03.8287104+02:00 0HMAHR34LLGHA:00000018 [INF] Executed endpoint '"UniversalDashboard.Controllers.SessionController.Index (Universal.Server)"' (99874f2b)
2021-07-28T17:04:03.8288024+02:00 0HMAHR34LLGHA:00000018 [INF] Request finished HTTP/1.1 GET http://localhost:8080/api/internal/session/bb32b3ac-7c65-49e0-912c-9e5cf53099a2 - - - 200 0 - 19.3707ms (791a596a)
2021-07-28T17:04:08.7980201+02:00 0HMAHR34LLGHA:00000019 [INF] Request starting HTTP/1.1 GET http://localhost:8080/api/internal/session/bb32b3ac-7c65-49e0-912c-9e5cf53099a2 - - (ca22a1cb)
2021-07-28T17:04:08.7992969+02:00 0HMAHR34LLGHA:00000019 [INF] Executing endpoint '"UniversalDashboard.Controllers.SessionController.Index (Universal.Server)"' (500cc934)
2021-07-28T17:04:08.7993645+02:00 0HMAHR34LLGHA:00000019 [INF] Route matched with "{action = \"Index\", controller = \"Session\"}". Executing controller action with signature "System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.IActionResult] Index(System.String)" on controller "UniversalDashboard.Controllers.SessionController" ("Universal.Server"). (122b2fdf)
2021-07-28T17:04:08.8013103+02:00 0HMAHR34LLGHA:00000019 [INF] Executing HttpStatusCodeResult, setting HTTP status code 200 (e28ccfae)
2021-07-28T17:04:08.8014054+02:00 0HMAHR34LLGHA:00000019 [INF] Executed action "UniversalDashboard.Controllers.SessionController.Index (Universal.Server)" in 2.0139ms (afa2e885)
2021-07-28T17:04:08.8014289+02:00 0HMAHR34LLGHA:00000019 [INF] Executed endpoint '"UniversalDashboard.Controllers.SessionController.Index (Universal.Server)"' (99874f2b)
2021-07-28T17:04:08.8015261+02:00 0HMAHR34LLGHA:00000019 [INF] Request finished HTTP/1.1 GET http://localhost:8080/api/internal/session/bb32b3ac-7c65-49e0-912c-9e5cf53099a2 - - - 200 0 - 3.5096ms (791a596a)
2021-07-28T17:04:09.1024358+02:00 0HMAHR34LLGHG:00000002 [INF] Client disconnected: okVSOFwOFkPc31KELGQvpw (d6fc55b2)
2021-07-28T17:04:09.1211238+02:00 0HMAHR34LLGHG:00000002 [INF] Executed endpoint '"/dashboardhub"' (99874f2b)
2021-07-28T17:04:09.1212862+02:00 0HMAHR34LLGHG:00000002 [INF] Request finished HTTP/1.1 GET http://localhost:8080/dashboardhub?dashboardId=1&id=mbINVfYiHV70l4yhewFqaA - - - 101 - - 10319.3382ms (791a596a)
Product: PowerShell Universal
Version: 2.1.3