问题描述
目前我的Google技能尚缺乏.我什么时候应该使用IIS Express,IIS,Project,Executable?每个优点/缺点是什么?
My Google skills are currently lacking at the moment. When should I be using IIS Express vs. IIS vs. Project vs. Executable? What are the pros/cons of each?
推荐答案
- IIS Express :运行IIS Express开发服务器后的ASP.NET Core应用程序的常见默认设置.这是一个很好的默认设置.
- IIS :当您实际安装了完整的IIS时,可以进行设置,以便您的应用程序直接在IIS后面运行.对于开发而言,这并不是一个很好的选择,至少对于ASP.NET Core而言,不是一个好选择,而且我什至不知道这种方法是否可以在ASP.NET Core中正常使用.
- 项目:这会将应用程序作为控制台应用程序运行.结果,这与从命令行运行
dotnet run
相同.这也是调试的一个很好的选择,因为您可以直接看到日志记录输出.根据目标生产环境的不同,这可能比在IIS Express上运行还要有意义. - 可执行文件:这使您可以运行任意可执行文件.这对于运行ASP.NET Core项目并没有真正的作用.
- IIS Express: A common default that runs the ASP.NET Core application behind the IIS Express development server. This is a good default.
- IIS: When you actually have a full IIS installed, you can set this up, so that your application runs directly behind IIS. That isn’t really a good choice for development, at least not for ASP.NET Core, and I actually don’t even know if this works properly with ASP.NET Core.
- Project: This runs the application as a console application. As a result, this is the same as running
dotnet run
from the command line. This is also a very good option for debugging, as you can directly see the logging output. Depending on your target production environment, this might even make more sense than running behind IIS Express. - Executable: This allows you to run an arbitrary executable. That’s not really useful for running your ASP.NET Core project.
所以基本上可以归结为IIS Express或Project.这是默认情况下在ASP.NET Core应用程序模板随附的launchSettings.json
文件中也正确配置的这两个.
So basically it comes down to IIS Express or Project. These are the two that are also configured properly by default in the launchSettings.json
file that comes with the ASP.NET Core application template.
您是更喜欢IIS Express还是直接运行应用程序,可能取决于个人喜好.因此,只需尝试一下,看看对您来说感觉更好.
Whether you prefer IIS Express or running the application directly probably comes down to personal preference. So just give both a try and see what feels nicer to you.
这篇关于ASP.NET Core启动设置:IIS Express,IIS,项目,可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!