The type definition of an F# type provider often requires a constant expression, e.g. for the SQL type provider:
type dbSchema = SqlDataConnection<"Data Source=MySqlServer;Initial Catalog=MyDatabase;">
However, when committing the code to SCM, and further having a build server doing its thing, you probably don’t want to use the same connection string, but rather the connection string of a SQL server database that is generated from the build process.
Is there a solution for this problem?
It would be really nice to be able to make this work, as it would provide a compile-time check of the database access code.
Update The solution proposed by @tomaspetricek worked very well, but I had to add a provider name to the connection string:
<add name="DbConnectionString" providerName="System.Data.SqlClient" connectionString="Data Source=MySqlServer;Initial Catalog=MyDatabase;"/>