serve命令需要在Angular项目中运行-Azure应用程序服务(.NetCore和Angular应用程序)
我有一个Angular and.NetCore应用程序,正在部署到Azure应用程序服务(Windows) 我使用Azure管道,下面是我的管道配置 当我部署到应用程序服务时,这是我的文件夹结构。 这在我的ClientApp文件夹中。 我得到这个错误,我已经尝试了两个星期了serve命令需要在Angular项目中运行-Azure应用程序服务(.NetCore和Angular应用程序),angular,azure,asp.net-core,azure-web-app-service,Angular,Azure,Asp.net Core,Azure Web App Service,我有一个Angular and.NetCore应用程序,正在部署到Azure应用程序服务(Windows) 我使用Azure管道,下面是我的管道配置 当我部署到应用程序服务时,这是我的文件夹结构。 这在我的ClientApp文件夹中。 我得到这个错误,我已经尝试了两个星期了 The serve command requires to be run in an Angular project, but a project definition could not be found. fail
The serve command requires to be run in an Angular project, but a project definition could not be found. fail: Microsoft.AspNetCore.SpaServices[0]
The serve command requires to be run in an Angular project, but a project definition could not be found.
请帮助我,并告诉我在哪里错过了配置。
谢谢大家,我终于找到了解决办法。您不能运行
ng serve
,因为显然,它应该是静态文件呈现的。问题是env变量未设置为“Production”。然后您需要具有类似“ClientApp/Dist”的文件夹结构
第二个问题是没有使用--prod
希望这能节省一些人的时间。如果有人这样做成功,请从ClientApp和main的kudo控制台共享您的文件夹结构。谢谢你你选择的网络应用的语言和版本是什么?你可以阅读这篇文章,也许它会对你有所帮助。您是否使用
ng serve
启动服务器?由于clientApp文件夹是一个创建的Dist build,您需要一个服务器(IIS、Nginx)来承载这些静态文件。@NikhilWalvekar是的,我是