Replies: 1 comment
-
Of course right after I post for help I figure it out. It looks like I didn't have Web Sockets on for my Web App and its needed for Single R connection. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a decoupled Blazor Server project. I'm trying to fetch all my blog posts when this error occurs. Here is the code for the function:
`
private async Task<List> FetchBlogPostsAsync()
{
Logger.LogInformation($"Fetch Blog Posts Hit");
var recentBlogPosts = new List();
try
{
if (OrchardHelper == null)
{
Logger.LogInformation("Orchard Helper Null");
}
else
{
Logger.LogInformation("Orchard Helper Not Null");
}
}`
This works just fine when running locally on IIS Express, either in the release build or in the debug build. This also works fine with or without interactive rendering enabled.
But when I publish the app to my Azure Web Application, it fails to fetch the blog posts and these are in the logs:
2024-12-31 17:53:16.015 +00:00 [INF] Fetch Blog Posts Hit
2024-12-31 17:53:16.023 +00:00 [INF] Orchard Helper Not Null
2024-12-31 17:53:16.031 +00:00 [ERR] An error occurred while fetching blog posts.
System.NullReferenceException: Object reference not set to an instance of an object.
at OrchardCore.ContentRazorHelperExtensions.QueryContentItemsAsync(IOrchardHelper orchardHelper, Func`2 query)
at PumpPal.Page.Blog.FetchBlogPostsAsync() in C:\Users\justi\OneDrive\Desktop\PumpPalWebsite\PumpPal\Page\Blog.razor.cs:line 65
line 65 is the: var contentItems = await OrchardHelper.GetRecentContentItemsByContentTypeAsync("BlogPost", 20);
Now if I publish to the Azure Web Application with interactive rendering off. It will fetch the blog posts just fine. It's only if it is on that it fails and gets the reference errors.
Also I don't see any errors in the Orchard logs
Does anyone know of something like this? Any help to fix this would be great. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions