Could not resolve host '(localdb)' on Visu

2019-05-31 19:41发布

Developing an Asp.Net web Api working with SQL. I'm stuck at debugging app on my Mac. When calling methods, working with db, app returns instead this error: System.Net.Sockets.SocketException Could not resolve host '(localdb)'

Feels like a mistake is somewhere in this line (according to other answers): Web.config file

<connectionStrings>
    <add name="DefaultConnection" connectionString="Data Source=(localdb)\MSSQLLocalDB; MultipleActiveResultSets=True; AttachDbFilename=|DataDirectory|MyDatabaseContext-12.mdf" providerName="System.Data.SqlClient" />
  </connectionStrings>

This app works perfectly fine in VS for Windows. Any ideas?

Update: I have an sql server in azure, so I have a connection string. Any way to make it used instead of local?

0条回答
登录 后发表回答