C# 如何将我的 asp.net 项目发布到我的本地 iis?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1323577/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 15:08:41  来源:igfitidea点击:

how do i publish my asp.net project to my local iis?

c#asp.netiispublish

提问by Crash893

I've been looking and I've seen a few how-tos but I find them to be somewhat confusing.

我一直在寻找并看到一些操作方法,但我发现它们有些令人困惑。

Does anyone have a good tutorial or step by step writeup that's easy to follow for a newbie

有没有人有一个很好的教程或一步一步的文章,对新手来说很容易遵循

采纳答案by 48klocs

If you're just looking to run your application under IIS, setting up a virtual directory is pretty straightforward. If you're looking to test publish a build, the web deployment project is the way to go (you can do it from the command line and in VS.Net, it enables a "Publish" right-click option).

如果您只是想在 IIS 下运行您的应用程序,那么设置虚拟目录非常简单。如果你想测试发布一个构建,web 部署项目是要走的路(你可以从命令行完成,在 VS.Net 中,它启用了“发布”右键单击选项)。

回答by Bela

A good place to start would be looking into web deployment projects.

一个很好的起点是研究 Web 部署项目。

This link is for VS2008, but they also exist for VS2005

此链接适用于 VS2008,但它们也适用于 VS2005

VS2008 Web Deployment Project

VS2008 Web 部署项目

回答by Tiago Sch?ffer

In Visual Studio, go on project properties > tab web and check "Use Local IIS Web Server". Then, it will ask you to if you want to create the virtual directory, answer yes and vouala...you create a IIS virtual directory, when you run your application, they will run on IIS.

在 Visual Studio 中,转到项目属性 > 选项卡 web 并选中“使用本地 IIS Web 服务器”。然后,它会询问您是否要创建虚拟目录,回答 yes 和 vouala...您创建一个 IIS 虚拟目录,当您运行您的应用程序时,它们将在 IIS 上运行。

回答by skyfoot

You can publish your web app to an iis website. Click on Build > Publish Web app and select to publish to Local IIS website. Job done.

您可以将 Web 应用程序发布到 iis 网站。单击 Build > Publish Web app 并选择发布到本地 IIS 网站。任务完成。

For a local development environment this is fine but if you want to deploy to a test or staging server than look at another solution such as the Web Deployment project or use nant or msbuild.

对于本地开发环境,这很好,但如果您想部署到测试或登台服务器而不是查看其他解决方案,例如 Web 部署项目或使用 nant 或 msbuild。