简体   繁体   English

如何在本地运行ASP.NET C#Web应用程序?

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

For a web application I am using ASP.NET C# (OS- Windows7, .NET 4) and the task has done. 对于Web应用程序,我使用的是ASP.NET C#(OS-Windows7,.NET 4),任务已完成。 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). 但我不知道如何在Windows7以及Server 2008(在服务器2008中安装的.NET 4和IIS)中本地运行它。 And I have to run it in both the platfrom . 我必须在平台上运行它。 So any help please. 所以任何帮助请。 Thanks a lot. 非常感谢。

If you have IIS 7 installed on your Win 7 machine, then: 如果您的Win 7计算机上安装了IIS 7,则:

  1. Open you project in VS.NET 在VS.NET中打开您的项目
  2. Right click on your project's node in solution explorer and choose "Properties" 右键单击解决方案资源管理器中项目的节点,然后选择“属性”
  3. Switch to the "Web" tab. 切换到“Web”选项卡。
  4. Select the radio "Use Local IIS web server" 选择收音机“使用本地IIS Web服务器”
  5. Click the "Create Virtual Directory" button 单击“创建虚拟目录”按钮

That takes care of getting your application to run using IIS. 这需要让您的应用程序使用IIS运行。 You can also develop/debug ASP.NET applications like this. 您也可以像这样开发/调试ASP.NET应用程序。

As regards, deploying your ASP.NET application, after making sure all pre-requisites are installed. 关于在确保安装所有先决条件之后部署ASP.NET应用程序。 You'll need to use IIS Manager to create a website and associate that website to an application pool. 您需要使用IIS管理器创建网站并将该网站关联到应用程序池。

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). 首先,您需要在本地计算机上使用.NET 4 Framework ,并且必须从Windows 7添加IIS功能,添加/删除软件(激活功能)。 I presume you have Windows 7 Pro, because the home / basic edition aren't supporting server / development task like those. 我认为你有Windows 7 Pro,因为家庭/基础版不支持那些服务器/开发任务。

If this tasks already is done, i think you just have to put your files into the iis (standard) inetpub folder (c:\\inetpub\\wwwroot). 如果已完成此任务,我认为您只需将文件放入iis(标准)inetpub文件夹(c:\\ inetpub \\ wwwroot)。 You can configure IIS in Windows 7 on mostly the same way as in Windows Server 2008. 您可以在Windows 7中以与Windows Server 2008中相同的方式配置IIS。

Because it appears that you aren't a user of Visual Studio I would also recommend trying Visual Web Developer Express or WebMatrix. 因为您似乎不是Visual Studio的用户,所以我还建议您尝试使用Visual Web Developer Express或WebMatrix。 Both of those ships with an internal webserver that starts/stops themself while debugging the web application. 这两个都带有内部Web服务器,可以在调试Web应用程序时启动/停止自己。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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