I'm writing a desktop application in .NET 6 and using the User Settings feature to store some persistent configuration values. Because the application is portable, I sign the assembly with a strong name, so that if the executable changes location the user settings are still the same (like explained here). I use strong naming in Visual Studio with the following configuration:
Then I publish the application to a folder via Visual Studio with the following profile settings:
If I run the application, the user settings are saved with its path as identifier instead of the strong name.
But if I publish the application without the 'Produce single file' option activated, it will output the DLL's, runtime config and executable separately. If I run the application now, then the user settings are saved with the strong name as identifier.
Also, if I verify the files with the Strong Name Tool (sn -v) via the Visual Studio Developer Command Prompt, the DLL's are valid (the executable is not, but I think that is expected).
I expected the same when publishing to a single file. What changes with this option? And how do I get the same result as publishing to separate files?