Customize Application Data Folder

  • Thread starter Thread starter jtbjurstrom
  • Start date Start date
J

jtbjurstrom

The folder that the framework creates under the Application Data
folder is not consistent.

Instead of:
..\Local Settings\Application Data\My Company\MyApp.exe_Url_<guid>
\1.0.0.0\user.config

I would like to have
..\Local Settings\Application Data\My Company\My App
\1.0.0.0\user.config

Basically I'm trying to remove the guid. If this isn't possible with
the .NET Framework then I'd at least like to know where this guid
comes from.

Thank you,
Jayson B.
 
Basically I'm trying to remove the guid. If this isn't possible with
the .NET Framework then I'd at least like to know where this guid
comes from.

You can look at the Settings.Designer.cs file to see the implementation of
that part of your application. That should answer both the question of
where the GUID comes from, as well as provide a suggestion for at least
one way to change the behavior.

Pete
 
You can look at the Settings.Designer.cs file to see the implementation of
that part of your application. That should answer both the question of
where the GUID comes from, as well as provide a suggestion for at least
one way to change the behavior.

Pete

Thanks Peter,
I've checked that file out and all I see is a few attributes which
specify that the class was generated by a code generator and who that
code generator is.

[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]

[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator",
"8.0.0.0")]

Somewhere in ApplicationSettingsBase.Save() it determines the folders
to create. I know it gets the company folder under "Application Data"
from [assembly: AssemblyCompany("My Company")] in AssemblyInfo.cs and
the version folder name from [assembly: AssemblyVersion("1.0.0.0")],
also in AssemblyInfo.cs. But I cannot find where the the application
folder name comes from (i.e. ".\My Company\MyApp.exe_Url_<guidthing>
\1.0.0.0").

Jayson
 
Back
Top