Skip to content
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

Fix #3927: change to async method to avoid the exception. #3938

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

zyhfish
Copy link
Contributor

@zyhfish zyhfish commented Mar 3, 2024

No description provided.

@sbwalker sbwalker merged commit 99d4d5e into oqtane:dev Mar 4, 2024
1 check passed
@sbwalker
Copy link
Member

sbwalker commented Mar 4, 2024

@zyhfish this does not resolve the issue. I enabled the "break on exception" for NavigationException(which I had previously disabled based on the Microsoft guidance) and the exception still occurs:

image

@sbwalker
Copy link
Member

sbwalker commented Mar 4, 2024

I am going to roll back this PR as it causes a compilation warning as well (ie. "this async method lacks 'await' operators and will run synchronously")

@zyhfish
Copy link
Contributor Author

zyhfish commented Mar 4, 2024

Hi @sbwalker , this is weird, I verified the changes in my local and it works fine:
here is the screencast of how it works on my local:
https://drive.google.com/file/d/179nLo2bW6A3CHtVov0Ez5II00NF0R0Wn/view?usp=sharing

anyway, this should not be a real fix but just a trick to avoid the exception to display in the current thread.

@sbwalker
Copy link
Member

sbwalker commented Mar 4, 2024

In your screencast in the exception settings, it looks different than mine. The default Visual Studio setting is to have "Break when this exception type is thrown" (like my screen shot above). In yours, this option is not selected - instead you have "break when the exception is user handled" - which I believe is responsible for the different behavior.

image

@zyhfish zyhfish deleted the task/fix-pr-3927 branch March 4, 2024 14:59
@zyhfish
Copy link
Contributor Author

zyhfish commented Mar 4, 2024

Hi @sbwalker , thx so much for you checking, let me try to check whether can find another possible way to avoid this behavior.

@sbwalker
Copy link
Member

sbwalker commented Mar 4, 2024

@zyhfish Note that in the Microsoft issue I also provided some code which is in the Identity bits added to a default .NET 8 Blazor Web app... which appears to provide a workaround for this bug:

dotnet/aspnetcore#53996 (comment)

Note this this exception does not happen in production - it only happens in Visual Studio when running a debugger - so although it is annoying for developers, there is a workaround by modifying the exception settings - and it does not affect production apps.

@JPScerri
Copy link

@zyhfish Note that in the Microsoft issue I also provided some code which is in the Identity bits added to a default .NET 8 Blazor Web app... which appears to provide a workaround for this bug:

dotnet/aspnetcore#53996 (comment)

Note this this exception does not happen in production - it only happens in Visual Studio when running a debugger - so although it is annoying for developers, there is a workaround by modifying the exception settings - and it does not affect production apps.

I got the same issue. If I ignore this error, when I publish in Azure, the server is throwing Internal Error.!!

@zyhfish
Copy link
Contributor Author

zyhfish commented Dec 12, 2024

I got the same issue. If I ignore this error, when I publish in Azure, the server is throwing Internal Error.!!

That should be caused by different error, you can enable the .net log by changing stdoutLogEnabled to true in web.config, then you can get the exact error messages from the log files under logs folder:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants