After finishing a project locally, we need to deploy it on the sever. I am using Plesk Hosting. There are still some issues about deployment:
Firstly, after uploading the files onto the server, we need to create a database and transfer the data from local one to the remote one.
Secondly, we need to change a bit in Web.config
file.
a. Change the connection string from
<connectionStrings> <add name="AucklandHighSchoolEntities" connectionString="metadata=res://*/Models.Management.csdl|res://*/Models.Management.ssdl|res://*/Models.Management.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=AucklandHighSchool;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" /> <add name="AucklandHighSchoolEntities2" connectionString="Data Source=.;Initial Catalog=AucklandHighSchool;Integrated Security=True;MultipleActiveResultSets=True;Application Name=EntityFramework" providerName="System.Data.SqlClient" /> </connectionStrings>
to:
<connectionStrings> <add name="AucklandHighSchoolEntities" connectionString="metadata=res://*/Models.Management.csdl|res://*/Models.Management.ssdl|res://*/Models.Management.msl;provider=System.Data.SqlClient;provider connection string="data source=198.71.225.145;initial catalog=AucklandHighSchool;Integrated Security=False;User ID=a;Password=******;Connect Timeout=15;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" /> <add name="AucklandHighSchoolAccountManagement" connectionString="Data Source=198.71.225.145;Initial Catalog=AucklandHighSchool;Integrated Security=False;User ID=a;Password=******;Connect Timeout=15;multipleactiveresultsets=True;Application Name=EntityFramework" providerName="System.Data.SqlClient" /> </connectionStrings>
b. Add the following code in <system.web>
tag:
<trust level="Full"/> <customErrors mode="Off" />
Or there will be errors:
c. Remove all the tags in <compilers>
tag, make it look like this:
<system.codedom> <compilers> </compilers> </system.codedom>
Or there will be errors:
Then I can run my website without any errors.
* You can visit the website on http://www.nickyli.net/