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

File upload crushes in debug mode #391

Open
AlexeyBoyko opened this issue Jul 25, 2023 · 7 comments
Open

File upload crushes in debug mode #391

AlexeyBoyko opened this issue Jul 25, 2023 · 7 comments

Comments

@AlexeyBoyko
Copy link

AlexeyBoyko commented Jul 25, 2023

For some reason it is not possible to debug my Blazor Server (NET 7.0) implementation of ICrudFileService because in debug mode file upload simply crushes without logging any messages to the console. Perhaps it is somehow related to the "File chooser dialog can only be shown with a user activation." problem which I encounter while debugging step-by-step ButtonFileClicked method. I was also able to hit breakpoint in OnChange() method of GridCreateComponent, but then it immediately crushes without any exceptions (adding try-catch inside OnChange and ErrorBoundary in my main layout didn't help to catch something). Seems that the process is simply killed.
Upd: Eventually I have managed to debug my error since it occured to be earlier in ICrudDataService which does not depend on file upload component. Still, it is quite complex to debug file processing code (if one needs to) without debug mode with just writing "breakpoints" to console.

@gustavnavar
Copy link
Owner

Package 4.0.5 include try / catch in the OnChange method of GridCreateComponent and GridUpdateComponent

@AlexeyBoyko
Copy link
Author

Thank you! But actually it does not help to catch the error. If I put breakpoint at the first line within try-catch block of OnChange() method, it stops there for a second or less and then application silently crushes without catching anything and hence nothing is written in console output (except that the process finished with code -1).

@AlexeyBoyko
Copy link
Author

Just in case... have you tried it for yourself to upload file in debug mode? If it works smoothly, then could the reason of our app's crushing be some bug that you have fixed earlier this year? As a matter of fact we use GridBlazor source codes in our project (not package) and we have never updated them since March.

@gustavnavar
Copy link
Owner

gustavnavar commented Aug 8, 2023

I've just test it using one of my projects and it works fine in debug mode. The used version is 4.0.4.

I've also upgraded to the last version (4.0.5) with no issues.

By the way, this app uploads a file to the server, and the server stores it in Azure Store.

@AlexeyBoyko
Copy link
Author

Hello! Eventually I decided to try out your example app and it failed in debug mode similarly just after I have chosen a file to upload. It stopped for about a second on the breakpoint on first line of the GridCreateComponent.OnChange() method and then crushed. I tried it on the EmployeeComponent.razor which shows up after clicking Employee's Grid label on Embedded page.

@AlexeyBoyko
Copy link
Author

"By the way, this app uploads a file to the server, and the server stores it in Azure Store." - didn't really catch the point, how can the way we store file be related with the current problem of debugging the app?

@AlexeyBoyko
Copy link
Author

AlexeyBoyko commented Aug 22, 2023

As far as I understand your sample app (the one available after clicking on the "Employees" button of this sample https://gridblazor.azurewebsites.net/embedded) uploads file to cloud service. On the contrary, our app stores uploaded files in database. Still, both crush in debug mode just after the file has been chosen.

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

No branches or pull requests

2 participants