Asp.net 在VisualStudio项目中启动调试模式时未加载资源
我正在调试模式下启动一个VS项目(ASP.Net和Angular),但没有加载任何资源 Index.cshtmlAsp.net 在VisualStudio项目中启动调试模式时未加载资源,asp.net,asp.net-mvc,razor,Asp.net,Asp.net Mvc,Razor,我正在调试模式下启动一个VS项目(ASP.Net和Angular),但没有加载任何资源 Index.cshtml @section scripts { <script src="~/dist/inline.bundle.js" asp-append-version="true"></script> <script src="~/dist/polyfills.bundle.js" asp-append-version="true"></s
@section scripts {
<script src="~/dist/inline.bundle.js" asp-append-version="true"></script>
<script src="~/dist/polyfills.bundle.js" asp-append-version="true"></script>
<script src="~/dist/vendor.bundle.js" asp-append-version="true"></script>
<script src="~/dist/main.bundle.js" asp-append-version="true"></script>
}
<div class="navbar navbar-dark bg-dark">
<a class="navbar-brand" href="#">@(ViewBag.Message ?? "SPORTS-STORE")</a>
</div>
<div class="p-1 bg-info">
calling app.component.html:
<app-root></app-root>
</div>
这些文件存在于我的项目中的路径
~/dist/
。我可能做错了什么?您是否在wwwroot
文件夹中有dist
文件夹。通常,您需要运行命令npm run build
,该命令将创建dist文件夹。因此,每次更改项目时,我都需要手动将dist文件夹复制到wwwroot?在angular app中,您有package.json
文件。那么你能在这个文件中共享scripts
json属性值吗?@mohsimehood添加到帖子中,如果你还需要什么,请告诉我更新package.json中的“build”:“ng build--deploy url/dist/”,然后运行命令npm run build
,它会在wwwroot文件夹中创建dist文件夹
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
}