Replies: 5 comments
-
If I hard code a value for the count then it works in IIS, but any query (async or not) results in a count value of 0 on IIS. I have separately confirmed that the assigned app identity in IIS has permission to execute the stored procedure used. Besides, there is no error occuring becauase of any type of database issue. In the following code block I have also tried to retrieve and set the value synchronously. It works in IIS with 17 hard coded as shown (and also async) but it does not work (count = 0) if I assign the value of count instead. WTF?
|
Beta Was this translation helpful? Give feedback.
-
Hello @mnbob70, |
Beta Was this translation helpful? Give feedback.
-
Thank you for the suggestion but this is not a connection string or query issue. The application is using the same database and connection string whether running locally or on IIS. The stored procedure is correct because it works correctly locally and in SSMS. Also, the same database is queried for both the count and the list of items. I just changed the items stored procedure to return the count and it still does not have a >0 value in IIS. This is what my async method looks like with the stored procedure change:
The items are displayed but FailedEmailCount is still 0. Locally, FailedEmailCount is 17 just like all of my other attemps to fix this. |
Beta Was this translation helpful? Give feedback.
-
At this point I can only assume I'm experiencing a strange bug under IIS and I'm always extremely hesitant to assume a bug. Any query for int values somehow results in 0 being assigned while running under IIS. I've added a string to my stored procedure just for testing purposes and I'm only querying simple data synchronously. The stored procedure returns an int value (17) and a string value (String from proc). After assigning to two different variables, both int assignments become 0 while the string assignments work. Why is Blazor not accepting the int assignments?!!! I've simplified this down to the following code:
|
Beta Was this translation helpful? Give feedback.
-
Talking to myself... Modifying the stored procedure works in some cases so I believe I've narrowed this down to some type of database permission issue even though I'm not receiving any errors. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
.NET 9 Blazor static SSR application.
I am completely stumped by an issue I am experiencing. I have a page that retrieves two data items asynchronously. One is a simple count (int) and the other is an item list for display in a table. Note that retrieving the item list works correctly.
No matter what I do, the count value is 0 when the application runs hosted in IIS while it is 17 when running in Visual Studio. I originally had two variables and set both with await statements in OnInitializedAsync. Since then I have tried all kinds of alternatives including setting the count value synchronously. Currently I have a separate nullable myData object to hold both the count and the item list and check that value to see if it is null. I have also completely commented out the retrieval of the item list so I'm only dealing with the count and still the value is treated as 0 in IIS. This issue occurs with stream rendering on or off (currently on as shown below).
Here is the output in Visual Studio:
Here is the output in IIS:

Code:
private string Title { get; set; } = "App Monitor";
//private int? failedEmailCount;
//private AppMonitorRow[]? items;
private AppMonitorData? myData;
Here is the relevant part of the html.
At the statement if (myData.FailedEmailCount > 0) the count is 0 because "(myData is null)" flashes in IIS as it's removed when myData ends up with a value.
Beta Was this translation helpful? Give feedback.
All reactions