How do I deploy my ASP MVC project to my Win7 system?
I am deploying my first ASP MVC project. The project runs just fine, I would like to take the next step and run this outside of my visual studio environment on my local IIS. I am running Windows7, Visual Studio 2008, and I have create开发者_如何学运维d a basic ASP MVC project.
On my solution, I find the project I would like to deploy. I right click and select Publish. I have backed up C:\inetpub\wwwroot\ and would like to deploy there. I accept all defaults, and click the "Publish" button. The Output Build window shows 1 project failed.
Basically is says that it is unable to add any of the binaries to the site, copy files, create new directories... Access is denied.
When I do click "Publish" at work, I don't get these errors. What do I have to do here to publish the website to make the website available to the rest of my home network? Also wwwroot appears to be readonly, but telling the folder to not be read only doesn't seem to help, it still appears to be readonly even after I've unselected this property in the property dialog.
There has been a suggestion that on Win7, you launch VS2008 as an Admin. While this does appear to work, I find it hard to believe that this is the "way" you do it.
If it is a permission problem, you should be able to solve it by adding permissions for your regular user account to the c:\inetpub\wwwroot directory.
I'm not on a Windows 7 system to get the exact steps, but it goes something like:
- Right click on the wwwroot directory, select Properties
- Select the security tab from the properties dialog
- Click the advanced button
- in the Permissions tab, add yourself (or the Users group) and set the privledges for full control.
- Make sure to check the boxes so that the permissions are applied recursively to the directory
- Click OK
I am assuming that security isn't an issue for you at this point because this is on your local system. It is less secure to allow other than admin users to mess with your website root. If you are going to expose this to the Internet, you should make sure the directory is locked down for everyone but admins.
An alternate approach would be to publish to some other directory, then try to copy the files into c:\Inetpub\wwwroot. If you use the file explorer to do the copy, it should prompt you to elevate your permissions to Administrator and will then copy the files.
It is permission, make sure that you are able to write to the folder. You can publish to your documents and then copy there to test that you can publish.
精彩评论