I am using the entity-framework with Code First approach and I have a custom DbContext. My connectionstring is defined in the ServiceConfiguration.Cloud.cscfg and ServiceConfiguration.Local.cscfg files.
public CustomContext()
: base("dbActivity")
{
...
When the above code executes, it tries to check my web.config and not the ServiceConfiguration file from an azure solution.
UPDATE: Here is my connectionString in the ServiceConfiguration file:
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="dbActivity" value="Server=tcp:xxx.database.windows.net,1433;Database=ra;User ID=user;Password=password;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" />
</ConfigurationSettings>
Exception:
No connection string named 'Server=tcp:xxx.database.windows.net,1433;Database=ra;User ID=user;Password=password;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;' could be found in the application config file."
Is it possible to make it check the ServiceConfiguration.Local.cscfg instead?