Sportsstore is the MVC project demonstrated in the master ASP. NET MVC3 Framework (third edition), which covers many aspects of MVC, including: Using di containers, URL optimization, navigation, paging, shopping carts, orders, product management, image uploads ... is a good MVC practice project, but the project is not developed in a multi-layered framework, and there is a distance from the real project. This series will attempt to implement the Sportsstore project in a multi-layered framework and implement some functions in its own way.
This article is the eighth in the series, including:
Deploy to an IIS server
-10.1 Publishing with Visual Studio
-10.2 Creating and configuring the IIS Web site
10. Deploy to the IIS server
10.1 Publishing with Visual Studio
→ Right-mysportsstore.webui this ASP. NET MVC Project and select "Publish".
→ On the Left "Profile" tab, click the drop-down list box and click "New".
→ Enter a profile name and click "OK".
→ For example, create the "Mylocalsportsstore" folder in the F-drive.
→ On the Left "Connection" tab, publish method Select "File System", Target location Select "Mylocalsportsstore" folder of F-Drive, click "Publish".
The Output window shows whether the publication was successful:
There are published files in the "Mylocalsportsstore" folder of the F-drive:
10.2 Creating and configuring the IIS Web site
→ Right-click Default Web Site and select Add "Application".
→ under "aliases", fill in the name of the website, and under "Physical path", select the "Mylocalsportsstore" folder for the F-drive.
→ Click "select" Next to "Application Pool", select "ASP. v4.0" option and click OK.
→ Click OK, under the Default Web site there are more mysportsstore sites.
→ Click "Browse ..." to the right of the IIS Admin interface.
Error found: CS0016: Failed to write output file "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP. files\mysportsstore\ F81e08a5\1a1a8940\app_global.asax.javyxvbb.dll "--" denied access. ”
The temp directory under the system directory does not have the appropriate permissions.
Locate the C:\c:\windows\temp folder, right-click, Properties, Security tab, select "Iis_iusrs", edit, select "Modify" and "write" permissions, OK.
Browse again, error: User ' IIS apppool\asp.net v4.0 ' login failed. The application pool option may be incorrect.
IIS Manager, application pool, right-click ASP. v4.0, select "Advanced Settings", identify select "LocalSystem", OK.
Browse again, Success!
This concludes the deployment.
"MVC Project Practice, implementing Sportsstore in a three-tier architecture" series includes:
MVC project Practice, in the three-tier architecture implementation of SPORTSSTORE-01,EF Code first modeling, DAL layer and other MVC project practices, in the three-tier architecture implementation of the Sportsstore-02,dbsession layer, the BLL Layer MVC Project Practice, Implement MVC project practices such as the Sportsstore-03,ninject controller factory in the three-tier architecture, implement SPORTSSTORE-04 under the three-tier architecture, implement the page-out MVC project practice, implement SportsStore-05 under the three-tier architecture, and implement navigation MVC Project Practice, implementation of SportsStore-06 in the three-tier architecture, implementation of the shopping Cart MVC project, implementation of SPORTSSTORE-07 in the three-tier architecture, implementation of the Order Submission MVC Project practice, implementation of SportsStore-08 under the three-tier architecture, Deploying to an IIS server