-
Notifications
You must be signed in to change notification settings - Fork 389
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
Setting do not work on NEW VB .Net 5 Winforms application #7448
Comments
Hey Paul, thanks for reporting this. Project System knows about general issues with conflicting Framework/.NET Core/5 assembly versions, and we're working on a solution. @KathleenDollard for FYI! |
@KlausLoeffelmann, it seems if you delete the problem sections from App.Config manually. You can change setting and the changes work at runtime and the error doesn't happen of course you lose the features you comment out (Logging). |
@KlausLoeffelmann is this tracked somewhere to which we can link? |
I just ported a 10 year old WinForm app to .Net Core 5 using TryConvert. It used SQL, Excel and Office Interop and it went flawlessly except for the issue with App.Config any update on when this might be fixed, what does external issue mean? Also found a subtle bug in the code flagged by newest ,Net analyzers. |
It means just that, the issue is external to our codebase. @KlausLoeffelmann the stack trace in https://github.com/dotnet/winforms-designer/issues/3596 looks very similar.
|
Tagging subscribers to this area: @safern Issue Details
Problem description:
Expected behavior: Minimal repro:
Manually deleting system.diagnostics section fixes the issue until a rebuild.
From here down works
|
This issue is blocking migration scenarios. |
cc @dotnet/area-system-configuration |
Probably related to dotnet/runtime#931, cc @JeremyKuhne @paul1956 could you try the workaround mentioned here dotnet/runtime#931 (comment)? |
@buyaa-n this needs to be fixed in .NET 6.0 timeframe (and possibly serviced in .NET 5.0 and 3.1?). This is a regression which is blocking migration scenarios. |
@buyaa-n I read the workaround multiple times and I don't see what I need to do. I don't have any code that looks like that.
|
@paul1956 am I correct that you don't need the If so, perhaps this is something that the project system should not add for .NET Core based projects. |
@danmoseley I only use userSettings. If I edit the APPLICATIONNAME.dll.config file and delete the 2 problem sections they come back when I rebuild. If I edit the application.config file the issue doesn't come back for that project. The problem happens in two scenarios, "New Projects" where the project system adds the Diagnostic and Switches sections and at least initially they are not used and may never be so deleting it should not be an issue, and ported projects (either manually or with TryConvert). In the TryConvert and manual porting scenario the data in Version and PublicKeyToken are wrong (it is 4.0.0.0 or less and has a different PublicKeyToken) and unless you read this thread you have no idea where to get the values.
I don't know what switches does so it might work or not, Logging might work if I knew how to set the Type Line above. Related issue is, it fails pointing to perfectly valid code (that I need) making it even more difficult to diagnose. |
@paul1956 sorry the workaround mentioned was in the above comment, here is the exact comment i wanted to read:
But it might not be directly be related to your issue, looks like it is more related to the @RussKie's exception log. Your issue (error log) might be related to dotnet/runtime#32307 and I am not sure if there is a workaround cc @eerhardt |
@buyaa-n I currently don't have apps that use exception log, I am working on a consumer medical display application where it would be very useful but as I said here the information to get it to work is missing. Where do I find "copy over the shared test app.config". All the app.config files that get installed with .Net have similar issues. |
I was able to reproduce this on a new .NET 5 VB WinForms app. You just need to "Add => New Item" and choose a "Settings" item. Add a new string setting named "username", and then add code to read the "username" property of a "new Settings1" object. The Moving to dotnet/project-system since this is a tooling issue, and not a runtime issue. The tooling shouldn't be generating this section. |
Hello project system friends, it would be great if you could take a look at this one as it is a migration blocker for some VB customers. |
@melytc Can you take a look at this? maybe get some context from @tmeschter |
cc @KathleenDollard this is a case where tooling apparently breaks upgrade of a VB app. It's writing extra stuff to the config that the runtime won't use, so the config system rejects it. |
As @paul1956 I have the same issues in .NET 6 and using "My.Settings". First workaround is deleting the app.config file, then run the project and works fine. Now, reading the Paul's workaround, instead of delete the <system.diagnostics> I comment it and now all is working. If I add or remove a value from settings, I didn't have any error, and the values are added (or deleted) from the app.config file and the commented section remains commented. Hope it's help. Guillermo P.S. |
The PR https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/403807 should handle the issue in |
FYI, |
No
Problem description:
Create a new VB WinForm App, that will read settings, add settings, run app and application will crash as below.
Expected behavior:
I can read settings
Minimal repro:
Contents of .config file
Manually deleting system.diagnostics section fixes the issue until a rebuild.
From here down works
The text was updated successfully, but these errors were encountered: