Search code examples
c#entity-frameworkasp.net-coreef-code-firstpublish

EF codefirst ClientConnectionId:xx.xxx.xx.xx Error Number:4060,State:1,Class:11


i beginner , please take it easy

i have asp.core web app with entity framework code first when i run on my laptop every things is ok and i want to publish give me this after the publish give me this enter image description here

now i want to run myapp.exe on server with this connection string

"server=***.*.*.*;database=myDB;uid=aa;pwd=bbbbbb",

i can login with this user and password

and give me this error enter image description here

i know that when i use ef code first . ef make new database when it dont exists i use this but doesnt work Scaffold-DbContext "Login Failed" "Error Number:4060,State:1,Class:11" please help me to publish this app


Solution

  • As far as I know, for your first error, you should make sure you have installed the asp.net core runtime for the IIS. Then you could run the asp.net core application on the IIS.

    Details, you could download it from this link.

    For the second error, I suggest you could make sure you have use the right connection string and update it into the appsettings.json. Besides, I suggest you could post the whole error not just part of callstack.