SportsStore is a master of ASP. the MVC project demonstrated in NET MVC3 framework (Third edition) covers many aspects of MVC, including: use DI container, URL optimization, navigation, paging, shopping cart, order, product management, Image Upload ...... it is a good MVC practice project, but it is not developed under a multi-layer framework, and there is still a distance from the real project. This series will try to implement the SportsStore project in a multi-layer framework and implement some functions in its own way.
This is the eighth article in the series, including:
■ 10. Deploy to the IIS server
□10.1 publish with Visual Studio
□10.2 create and configure an IIS website
10. Deploy to the IIS server
10.1 release with Visual Studio
→ Right-click the ASP. net mvc project MySportsStore. WebUI and choose publish ".
→ Under the "configuration file" tab on the left, click the drop-down list box and click "new ".
→ Enter the configuration file name and click "OK ".
→ For example, create the "MyLocalSportsStore" folder on drive F.
→ Under the "connection" tab on the left, select "File System" as the publishing method, select the "MyLocalSportsStore" folder for the F drive at the target location, and click "publish ".
In the "output" window, whether the publishing is successful is displayed:
A published file is available in the "MyLocalSportsStore" folder of drive F:
10.2 create and configure an IIS website
→ Right-click the Default Web Site and choose add application ".
→ Enter the website name under "alias" and select the "MyLocalSportsStore" folder of drive f under "physical path.
→ Click "select" next to "application pool", select the "ASP. NET v4.0" option, and click "OK.
→ Click OK. The MySportsStore website is added under the Default Web Site.
→ Click "Browse..." on the right of the IIS management interface ...".
Error: CS0016: failed to write the output file "c: \ Windows \ Microsoft. NET \ Framework64 \ v4.0.30319 \ Temporary ASP. NET Files \ mysportsstore \ f81e08a5 \ 1a1a8940 \ App_global.asax.javyxvbb.dll "--" Access denied. "
The Temp directory in the system directory has no corresponding permissions.
Find the C: \ Windows \ temp folder, right-click, properties, Security tab, select "IIS_IUSRS", edit, select "modify" and "write" permissions, and click OK.
When you browse again, the following error occurs: logon to 'iis APPPOOL \ ASP. NET v4.0 'fails. It may be that the application pool option is incorrect.
IIS manager, application pool, right-click ASP. NET v4.0, select "Advanced Settings", select "LocalSystem" as the ID, and click OK.
Browsing again, successful!
Now, the deployment is complete.
The series "MVC project practices, implementing SportsStore in a three-tier architecture" includes:
MVC project practice, under the three-tier architecture to achieve SportsStore-01, EF Code First modeling, DAL layer MVC project practice, under the three-tier architecture to achieve SportsStore-02, DbSession layer, BLL layer MVC project practice, in the three-tier architecture to achieve SportsStore-03, Ninject controller factory MVC project practice, in the three-tier architecture to achieve SportsStore-04, achieve paging MVC project practice, in the three-tier architecture to achieve SportsStore-05, implementation of navigation MVC project practice, in the three-tier architecture to achieve SportsStore-06, to achieve the shopping cart MVC project practice, in the three-tier architecture to achieve SportsStore-07, order submitted MVC project practice, in the three-tier architecture to achieve SportsStore-08, deploy to IIS server