从 cmd 启动网站

Start site from cmd

我正在尝试使用此命令从 cmd 在 IIS Express 上启动 ASP.NET MVC 项目

iisexpress /site:MySiteName

但我收到这条消息

The following site was not found in the configuration file

我在这里缺少什么!?

来自documentation

/config:config-file The full path to the applicationhost.config file. The default value is the IISExpress8\config\applicationhost.config file that is located in the user's Documents folder.

因此您需要添加配置键 /config: 并将路径写入您的配置。