【发布时间】:2020-12-10 13:01:40
【问题描述】:
我在 Visual Studio 中创建了应用程序 .net 3.0 + Angular 8。然后我将角度升级到版本。 10. 当我在本地运行应用程序时一切正常,但是当我在 iis 上发布它时出现此错误:
没有这样的文件或目录,打开 'C:\Websites\App\ClientApp\package.json'
我已经更改了 Startup.cs
services.AddSpaStaticFiles(配置 => { configuration.RootPath = "ClientApp/dist/App"; });
但这无济于事。
ver 8 在 iis 上运行没有任何问题。
我的包.json
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build:ssr": "ng run App:server:dev",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
编辑 在@Yiyi 你的帮助下,我继续前进。现在我得到了这个错误
The error output was: The serve command requires to be run in an Angular project, but a project definition could not be found.
我更新了everytning(角度、节点等),将变量 npm 添加到 PATH,将 package.json 和 node_module 复制到项目,添加了对 app_pool 的权限
感谢您的帮助
【问题讨论】:
标签: angular asp.net-core iis publish angular10