Blazor WebAssembly 本地调试时如何将项目运行在子目录

假设项目名为MyApp,想要运行的子目录名也叫MyApp

MyApp.csproj

<PropertyGroup>
	<StaticWebAssetBasePath>MyApp</StaticWebAssetBasePath>
</PropertyGroup>

Properties/launchSettings.json

    "https": {
      "commandName": "Project",
      "commandLineArgs": "--pathbase=/MyApp",
      "launchBrowser": true,
      "launchUrl": "MyApp/",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "dotnetRunMessages": true,
      "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/MyApp/_framework/debug/ws-proxy?browser={browserInspectUri}",
      "applicationUrl": "https://localhost:7270;http://localhost:5238"
    }

wwwroot/index.html

<base href="/MyApp/" />
posted @   Yu-Core  阅读(46)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示