简体   繁体   中英

publish MVC 3 app to localhost IIS 7

I have searched a lot and I have tried but couldn't published asp.net mvc 3 application on localhost. I have never tried before. I have currently adminpanel application running on development server of the visual studio. In my machine, following are installed:

  • IIS 7
  • windows 7
  • SQL server 2008
  • MVC 3
  • asp.net 4

In visual studio, I publish application using File System publish method and target path to C:\\inetpub\\wwwroot\\adminpanel. And Following Directory and files were copied.

Directory

  • App_Data
  • bin
  • Content
  • Scripts
  • Views
  • Visual Studio 2010

Files

  • Global.asa
  • Packages.xml
  • Web.xml

I don't know but I think Some directory's are missing like the controllers, Helpers, Models, Sources which I have seen in Visual Studio Solution Explorer. When I browse to http://localhost/adminpanel , it shows all directory and files list in browser.

How to publish the application to IIS and use SQL server of local machine so that I can browse to particular controller like http://localhost/User/UserManager which I can do in the dedicated server of the visual studio.

I don't know but I think Some directory are missing like controllers, Helpers, Models, Source which I have seen in Visual Studio Solution Explorer.

That's perfectly normal. ASP.NET MVC 3 uses an ASP.NET application type (in contrast to ASP.NET WebSite) meaning that it is precompiled and all the source code is removed when deploying. Only the Views, Static resources such as CSS, Images and Scripts as well as the bin folder containing the compiled assemblies is deployed.

Basically, I think your Site has not been defined as a application in the IIS. You can do it from IIS manager.

But, instead, when you publish the the application, select File System but instead of browsing to the mentioned Folder, in Target Location field click the button next to the text box and select Local IIS on the left side. Now you can create a Application Folder and directly publish into it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM