03.11.2016 Views

Beginning ASP.NET 4.5 in CSharp and VB Opsylum

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

756 x CHAPTER 19 DEPLOYING YOUR WEBSITE<br />

5. Close the dialog box so you return to the Release Properties dialog box shown <strong>in</strong> Figure 19-12.<br />

6. Click the Advanced button to open the Advanced Security Sett<strong>in</strong>gs dialog box aga<strong>in</strong>. For W<strong>in</strong>dows<br />

7 <strong>and</strong> Server 2008 R2, click the Change Permissions button <strong>and</strong> check the Replace All Child Object<br />

Permissions check box. For W<strong>in</strong>dows 8 <strong>and</strong> Server 2012, you f<strong>in</strong>d this check box on the Advanced<br />

Security Sett<strong>in</strong>gs dialog box directly. This forces W<strong>in</strong>dows to apply the same security sett<strong>in</strong>gs to all<br />

sub files <strong>and</strong> folders, replac<strong>in</strong>g all exist<strong>in</strong>g sett<strong>in</strong>gs. Click OK <strong>and</strong> then confirm the changes that<br />

will be made. F<strong>in</strong>ally, close all rema<strong>in</strong><strong>in</strong>g open dialog boxes.<br />

7. Back <strong>in</strong> File Explorer / W<strong>in</strong>dows Explorer, rightclick<br />

App_Data from the Release folder, open its<br />

Properties dialog box <strong>and</strong> then its Security tab, <strong>and</strong><br />

edit the permissions for the web server account you<br />

added <strong>in</strong> step 4 by add<strong>in</strong>g Modify permissions (this<br />

<strong>in</strong> turn causes some of the other permissions to be<br />

selected as well). You need to click the Edit button<br />

first to br<strong>in</strong>g the Properties dialog box <strong>in</strong> editable<br />

mode. Figure 19-14 shows the completed dialog.<br />

Click OK to close the dialog box.<br />

8. Repeat this step for the GigPics folder <strong>and</strong> optionally<br />

for the TempMail folder.<br />

9. If you are us<strong>in</strong>g IIS on a mach<strong>in</strong>e that has SQL<br />

Server Express, the f<strong>in</strong>al th<strong>in</strong>g you need to do is<br />

modify your connection str<strong>in</strong>gs. If you don’t have<br />

SQL Server Express <strong>in</strong>stalled, refer to the start of<br />

Chapter 12 that shows you how to <strong>in</strong>stall SQL<br />

Server Express Edition as well as SQL Server<br />

FIGURE 19-14<br />

Management Studio Express Edition. If you’re us<strong>in</strong>g<br />

a different database server, or if you only have SQL Server Local DB Edition <strong>in</strong>stalled <strong>and</strong> don’t<br />

want to <strong>in</strong>stall SQL Server Express, look at the section “Mov<strong>in</strong>g Data to a Remote Server” later <strong>in</strong><br />

this chapter <strong>and</strong> look at Appendix B, which expla<strong>in</strong>s how to configure a different SQL Server.<br />

To modify the connection str<strong>in</strong>g, open up Web.config <strong>and</strong> replace both occurrences of<br />

(LocalDB)\v11.0 <strong>in</strong> the connection str<strong>in</strong>gs with .\SqlExpress. This targets a named <strong>in</strong>stance<br />

of SQL Server called SqlExpress on the local mach<strong>in</strong>e (identified by the dot (.)). In addition, add<br />

User Instance=True to both connection str<strong>in</strong>gs to run SQL Server under the same user account<br />

as the website. Your connection str<strong>in</strong>gs should end up like this:<br />

<br />

<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!