-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error running on Azure #1
Comments
Maybe related to A published blazor wasm app throws a serialization error "Unhandled exception rendering component: ConstructorContainsNullParameterNames". If the deployment is in release mode instead of debug mode it could point to trimming issues - try adding the following to your csproj file and republish the app again.
|
Hi, yes have tried all of the recommendations due to trimming issues. Do you have this code working from Azure? |
This issue does appear to be related to generic KeyValuePair, I tried non-generic DictionaryEntry and it worked fine. Try changing from
To the following
You will also have to unbox the string values from the This problem was also raised in blazor wasm throwing deserialization exception when published with an example. |
I made the Unfortunately, navigating to the 'Users.razor' page deployed to Azure now returns the following error: All seems to be working OK in debug and release mode in VS2022. Inspecting objects at breakpoints shows everything as it should be when running on the local machine. I've not yet looked into this error, but have a suspicion that it is caused by the .0.0 that follows the 8 So, no solution yet :-( |
Try enabling detailed runtime logging with the following: import { dotnet } from './dotnet.js'
await dotnet
.withDiagnosticTracing(true) // enable JavaScript tracing
.withConfig({environmentVariables: {
"MONO_LOG_LEVEL":"debug", //enable Mono VM detailed logging by
"MONO_LOG_MASK":"all", // categories, could be also gc,aot,type,...
}})
.run(); Taken from Runtime logging and tracing for WASM. @kg Any other suggestions? Try using |
Yes, your suggestions are good and setting |
This code works fine running locally in Visual Studio 2022, but fails to retrieve the list of users when deployed to Azure (.NET 8 Early Access). The error is not browser specific, but seems to be the hosting at issue. Exception is on the users.razor page:
The issue would appear to be with
System.Text.Json
not supporting KeyValuePair deserialization.So far I've tried replacing the KeyValuePair with a
List<KeyValueClass>
and again works fine locally to display a list of users with claims on the users.razor page, but fails gain when deployed to Azure.The replacement class used to retrieve a user record:
record User(Guid Id, string Email, string LockedOut, string[] Roles, List<KeyValueClass> Claims, string DisplayName, string UserName);
Targeting the api directly from the browser (and postman) also returns perfectly good json, ie.:
https://??????????????????.azurewebsites.net/api/identity/userlist?skip=0&limit=10
Returned Raw Data example:
In both cases (VS2022 local, and Azure deployment) the data is coming from the same Azure SQL Database.
Anyone else getting the same issue?
The text was updated successfully, but these errors were encountered: