Pay attention to the following points when deploying a project to a server:
1. The connection string is generally used for windows Authentication during local development, but SQL server authentication is used on the server. The following error may occur. User 'nt AUTHORITY \ NETWORK service' Login Failed and then look at the web. the connection string <add name = "Letters_ManagementEntities" connectionString = "metadata = res: // */Model. letter. csdl | res: // */Model. letter. ssdl | res: // */Model. letter. msl; provider = System. data. sqlClient; provider connection string = & quot; Data Source =. \ sqlexpress; Initial Catalog = Letters_Management; Integrated Security = True; MultipleActiveResultSets = True; App = EntityFramework & Quot; "providerName =" System. data. entityClient "/> note the blue annotation, which indicates windows authentication, so you need to change the SQL server Authentication, <add name = "Letters_ManagementEntities" connectionString = "metadata = res: // */Model. letter. csdl | res: // */Model. letter. ssdl | res: // */Model. letter. msl; provider = System. data. sqlClient; provider connection string = & quot; Data Source = db.cloud.istudy.sh.cn; Initial Catalog = Letters_Management; user id = sa; password = Password01 !; Persist security info = True; MultipleActiveResultSets = True; App = EntityFramework & quot; "providerName =" System. data. entityClient "/> 2.css references an image. If there is only one project on the server, it does not matter. If there is a similar case, you need to change the image connection # logo {background-image: url (".. /Images/logo.jpg "); width: 100%; height: 142px; fill in the global style sheet. connections referenced in js often have such connections in the view. <a href = "~ /Home/writeletter "> writing letters </a> In the connection "~ "This symbol is not available in js files, so you need to use another url:" @ Url. action ("delete", "home", new {id = Model. ID}) "The connections in js will be automatically converted.