简体   繁体   English

从命令行运行 IIS Express.Net Core

[英]Running IIS Express from the Command Line .Net Core

In a project im working on, we are upgrading our Episerver CMS website from CMS11 (.net framework) to Optimizely CMS12 (.Net core) for a customer.在我正在进行的项目中,我们正在为客户将我们的 Episerver CMS 网站从 CMS11(.net 框架)升级到 Optimizely CMS12(.Net 核心)。

To run IIS Express using CLI (to not have the need to run the application from VS/Rider) and start NPM develop, we have written this.bat script.要使用 CLI 运行 IIS Express(无需从 VS/Rider 运行应用程序)并启动 NPM develop,我们编写了 this.bat 脚本。

@ECHO OFF

ECHO starting site
start iisexpress /config:.vs\*PROJECT_NAME*\config\applicationhost.config /siteid:2
cd %~dp0\src\Site
start npm run develop

As a result of upgrading from framework to core, we are now configuring the project through appsettings.json instead of applicationhost.config (XML), where we define which site bindings to be launched from (siteid:2).作为从框架升级到核心的结果,我们现在通过 appsettings.json 而不是 applicationhost.config (XML) 配置项目,我们在其中定义要从 (siteid:2) 启动的站点绑定。

I've been looking for a way to do the same through bindings in.json, with no luck.我一直在寻找一种方法来通过绑定 in.json 来做同样的事情,但没有成功。 Does anyone have any ideas for a solution?有人对解决方案有任何想法吗?

I would recommend using Kestrel instead of IIS Express locally and simply start the site with: do.net run我建议在本地使用Kestrel而不是 IIS Express,只需使用以下命令启动站点: do.net run

You can also use do.net watch to automatically rebuild/restart the site when source code files change.您还可以使用do.net watch在源代码文件更改时自动重建/重新启动站点。

https://learn.microsoft.com/en-us/as.net/core/getting-started/?view=as.netcore-7.0&tabs=windows#run-the-app https://learn.microsoft.com/en-us/as.net/core/getting-started/?view=as.netcore-7.0&tabs=windows#run-the-app

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

相关问题 从命令行运行 .NET Core 2.0 API - Running .NET Core 2.0 API from the command line ASP.NET 内核 Web 3.1 - IIS Express 可以从 localdb 获取数据,但本地 Z5DA5ACF461B4EFB27E6ZEC6 不能 - ASP.NET Core Web 3.1 - IIS Express can fetch data from localdb but local IIS can not 我在 iis express 中运行 asp.net core mvc 项目时遇到问题 - I have problem while running asp.net core mvc project in iis express 在IIS上运行.NET核心和.NET Web应用程序 - Running .NET core and .NET web applications on IIS 无法在从 .NET Core 运行的 linux 命令中设置输入文件 - Not possible to set input file in linux command running from .NET Core 在 .NET Core 中,如何向在本地服务器上运行的 API 发出 HTTP 请求(IIS Express 使用 VS 2019)? - In .NET Core, how do you make HTTP request to an API running on local server (IIS Express using VS 2019)? 如何从命令行发布 .Net Core ASP 便携版本? - How to publish .Net Core ASP portable version from command line? ASP.NET Core + IIS Express 如何设置 SSL 证书 - ASP.NET Core + IIS Express how to setup SSL Certificate ASP.NET Core IIS Express AD服务权限错误 - ASP.NET Core IIS Express AD Services Permissions Error 如何使用 IIS Express 在 ASP.NET Core 中获取控制台输出 - How to get a Console output in ASP.NET Core with IIS Express
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM