-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Crash when project lies at network location | Failed to save settings: An error occurred loading a configuration file #112410
Comments
This should be transferred to WinForms. I was unable to reproduce the issue. Tried v8, v9 and v10. |
@JeremyKuhne any thoughts? Should we transfer to WinForms for evaluation? |
@steveharter this shouldn't be specific to WinForms. You can add a Settings file (use the Settings template in add new item) to a console app with the ConfigurationManager package. @Rsge I also was unable to repro your described behavior with your project. |
@JeremyKuhne I figured as much, as this severe of an issue not already being listed here and also not really findable through normal search made me think I did something wrong, too. I just can't figure out what. I tried using The strange thing to me is that the only thing I change is the target framework, .NET 8 works, .NET 9 doesn't. If you need any further info, please don't hesitate to ask. |
This comment has been minimized.
This comment has been minimized.
@Rsge Perhaps enabling first chance exceptions will give us more of a clue. There is a lot of reflection going in |
Sorry for the late reply, this issue occurs at work and I don't work on all normal weekdays. I didn't know how to enable "first chance exceptions" and used Stackoverflow as a guide, I hope this is what you meant:
This seems to be the issue @JeremyKuhne: |
Your first-chance exception settings are correct: break on exceptions + have no exceptions that are ignored. However, can you click on "show call stack" when you get the exception and report back that information, so we get a call stack more than one level. Thanks. |
@steveharter But enabling |
I see the recent edits that the error occurs when saving to a UNC or network path. There was a recent issue UNC path issue fixed in 9.0 that should be in the 9.0.3 release, to be released sometime in mid-March. So I'm going to mark this as duplicate for now. Please reply to this once 9.0.3 is released to see if it fixes your issue. If not, we can continue diagnosing. Although I don't know the exact repro here, a somewhat common issue is that developers may be running Visual Studio as local machine admin which won't have network permissions. However, I don't think that is the case here otherwise it should also fail on previous releases. |
Description
When trying to save changed settings from a project on a network location (network drive or UNC path) in .NET 9 using
My.Settings.Save()
orProperties.Settings.Default.Save();
, respectively, a program crash occurs.Reproduction Steps
Test
with value"X"
.My.Settings.Test = "Y"
orProperties.Settings.Default.Test = "Y";
, respectively.My.Settings.Save()
/Properties.Settings.Default.Save();
TestC#VB.zip
Expected behavior
The program saving the settings to the default save location, as it did in .NET 8. No crash, obviously.
Actual behavior
The program crashes with the following error:
Regression?
Worked in .NET 8, 6 and 5 definitively and probably 7, too. Haven't tested .NET FW.
Known Workarounds
Don't put the project at a network location, but save it on a local drive.
Configuration
Haven't tested on other configurations.
Other information
—
The text was updated successfully, but these errors were encountered: