How to run ASP.NET C# web application locally?

三世轮回 提交于 2019-12-17 20:22:48

问题


For a web application I am using ASP.NET C# (OS- Windows7, .NET 4) and the task has done. But I don't know how to run it locally in Windows7 as well as in Server 2008(.NET 4 and IIS installed in server 2008). And I have to run it in both the platfrom. So any help please. Thanks a lot.


回答1:


If you have IIS 7 installed on your Win 7 machine, then:

  1. Open you project in VS.NET
  2. Right click on your project's node in solution explorer and choose "Properties"
  3. Switch to the "Web" tab.
  4. Select the radio "Use Local IIS web server"
  5. Click the "Create Virtual Directory" button

That takes care of getting your application to run using IIS. You can also develop/debug ASP.NET applications like this.

As regards, deploying your ASP.NET application, after making sure all pre-requisites are installed. You'll need to use IIS Manager to create a website and associate that website to an application pool.




回答2:


At first you need .NET 4 Framework on the local computer and you have to add the IIS functionality from Windows 7 corresponding add/remove software (activate functions). I presume you have Windows 7 Pro, because the home / basic edition aren't supporting server / development task like those.

If this tasks already is done, i think you just have to put your files into the iis (standard) inetpub folder (c:\inetpub\wwwroot). You can configure IIS in Windows 7 on mostly the same way as in Windows Server 2008.

Because it appears that you aren't a user of Visual Studio I would also recommend trying Visual Web Developer Express or WebMatrix. Both of those ships with an internal webserver that starts/stops themself while debugging the web application.



来源:https://stackoverflow.com/questions/5190217/how-to-run-asp-net-c-sharp-web-application-locally

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!