I have the following connection string:
<connectionStrings>
<add name="ContextName" connectionString="Data Source=.;Initial Catalog=ServerName;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
When I run my app, i receive the following error:
Server Error in '/' Application, Cannot open database “” requested by the login. The login failed
The error appears in this piece of code:
Hangfire.GlobalConfiguration.Configuration.UseSqlServerStorage("ContextName");
I am sure that the current user has all permissions. I have also tried idea from this article, but it did not work. Also I know that the database is not existing and I expect it to be created after the first get request. Any ideas how I could create the database without starting the app? Or how could I fix this problem in general?