我正在IIS上部署角构建,我认为主要的问题是基础
这是我的路径,在IIS管理器中托管有角生成。
,其中第一个ClientApp是我在IIS上的应用程序
E:\IIS Projects\ElasticCoreWebAPI_Public\feature\ClientApp\ClientApp\,这是我建造的
这是我的index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>KEENU CFRS</title>
<base href="/ClientApp">
<!--// "build": "ng build --base-href=/CFRS.WebUI/",-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body class="mat-typography">
<app-root>
<div class="main-spinner-wrapper">
<div class="donut"></div>
</div>
</app-root>
</body>
</html>这是我的package.json
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},这是我的构建发布命令
ng build --prod --base-href /ClientApp/
这就是建造的方向
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",我要去迪斯特修造了
这是我的内置输出图片

发布于 2020-11-13 12:27:48
我通过给出部署构建的服务器地址(如果构建部署在根文件夹中,然后在index.html中部署)来解决这个问题
<base href="/">如果网站部署在应用程序的物理文件夹中,那么当应用程序是浏览器时,从Url复制除根文件夹之外的Url,那就是您的WebsiteAddress
<base href="/WebSiteAddress">命令,如果在根文件夹中部署了build,则用于进行生产生成。
ng build --prod 如果网站部署在应用程序的物理文件夹中,那么
ng build --prod --base-href /WebSiteAddress/https://stackoverflow.com/questions/64388463
复制相似问题