-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Exception when renaming cshtml file in latest VS Windows #11720
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
Comments
Thanks @ToddGrun. @NTaylorMullen this is your to handle. |
Investigated this and have a few findings.
I'm going to take the approach of fixing 4 because this is a pretty common case that can't always be avoided. I wish I could mitigate it by dequeuing background parsing work; however, we aren't notified that it's actually gone until we've already thrown an exception. |
- This reduces the noise when a user renames a .razor file in VS. - Added tests to validate that we properly swallow FileNotFoundExceptions. During the fix of this I found: 1. It doesn't crash VS 2. It's unavoidable because our project manager can't guarantee that an underlying file won't disappear before processing it. 3. In VS' case renaming a Razor file doesn't result in the project system detecting its removal until after we've attempted to parse the deleted file. 4. This exception is reported to the activity log as an error. I took the approach of fixing 4 because this is a pretty common case that can't always be avoided. I wish I could mitigate it by dequeuing background parsing work; however, we aren't notified that it's actually gone until we've already thrown an exception. dotnet/aspnetcore#11720
Agreed, it's fundamentally a race condition. |
…d in ActivityLog. - This reduces the noise when a user renames a .razor file in VS. - Added tests to validate that we properly swallow IOExceptions and UnauthorizedAccessException. During the fix of this I found: 1. It doesn't crash VS 2. It's unavoidable because our project manager can't guarantee that an underlying file won't disappear before processing it. 3. In VS' case renaming a Razor file doesn't result in the project system detecting its removal until after we've attempted to parse the deleted file. 4. This exception is reported to the activity log as an error. I took the approach of fixing 4 because this is a pretty common case that can't always be avoided. I wish I could mitigate it by dequeuing background parsing work; however, we aren't notified that it's actually gone until we've already thrown an exception. dotnet/aspnetcore#11720
…d in ActivityLog. - This reduces the noise when a user renames a .razor file in VS. - Added tests to validate that we properly swallow IOExceptions and UnauthorizedAccessException. During the fix of this I found: 1. It doesn't crash VS 2. It's unavoidable because our project manager can't guarantee that an underlying file won't disappear before processing it. 3. In VS' case renaming a Razor file doesn't result in the project system detecting its removal until after we've attempted to parse the deleted file. 4. This exception is reported to the activity log as an error. I took the approach of fixing 4 because this is a pretty common case that can't always be avoided. I wish I could mitigate it by dequeuing background parsing work; however, we aren't notified that it's actually gone until we've already thrown an exception. dotnet/aspnetcore#11720
The text was updated successfully, but these errors were encountered: