I have a SQL Server CE database in a project that I will not store anywhere in the% AppData% directory. However, I cannot find a way to link to the application data path in the connection string (in App.Config)
<?xml version="1.0"?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="EntityConnectionString" connectionString="metadata=res://*/EntityModel.csdl|res://*/EntityModel.ssdl|res://*/EntityModel.msl;provider=System.Data.SqlServerCe.3.5;provider connection string="Data Source=|ApplicationData|\Entities.sdf"" providerName="System.Data.EntityClient"/>
</connectionStrings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
</configuration>
So far I have learned that:% APPDATA% is not supported, and using the settings class (for example, the proposed one) will also not work (the settings class is not created at the time the exception is already thrown).
Can I use the application data folder (or another special folder) in the connectionString property (in App.Config)?
Note: it looks like I'm looking for a solution to change the connection string (in code) as early as possible, and not for App.Config's own solution.