发布来自CMDline的托管大麻厂:浏览器 - 瓦斯和Palaformtarget x64不兼容

发布于 2025-02-03 17:12:33 字数 751 浏览 3 评论 0原文

我正在尝试发布ASP.NET托管的Blazor WASM应用程序,但我在发布中遇到了一些问题。我想发布一个X64独立应用程序,我正在使用服务器项目中的以下命令:

dotnet publish .\Wasm.Server.csproj -c Release --self-contained -r win10-x64

几个额外的注释:

  • 我的印象是,自从我创建了托管的WASM项目以来,然后,我应该仅通过发布服务器项目来获得我需要的一切(即,发布服务器项目将构建WASM项目并将所需的文件复制到服务器项目的wwwroot并将所有内容复制到输出文件夹))
  • 我想要服务器端(API)要自我包含,
  • 我正在使用Win10-X64,因为

不幸的是,Web应用程序将发布在Windows Serve Box上,这会生成以下错误:

C:\Program Files\dotnet\sdk\6.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(196,5): error NETSDK1032: The RuntimeIdentifier platform 'browser-wasm' and the PlatformTarget 'x64' must be compatible. 

有关如何解决此问题的任何线索?我已经在另一个盒子里测试了它,它似乎没有任何问题。

I'm trying to publish an ASP.NET hosted Blazor wasm app, but I'm having some issues with the publishing. I'd like to publish a x64 self-contained app and I'm using the following command from within the server project:

dotnet publish .\Wasm.Server.csproj -c Release --self-contained -r win10-x64

A couple of extra notes:

  • I'm under the impression that since I've created the wasm project as hosted, then I should get everything I need just by publishing the server project (ie, publishing the server project will build the wasm project and copy the required files into the wwwroot of the server project and copy everything to the output folder)
  • I want the server side (API) to be self contained
  • I'm using the win10-x64 because the web app will be published on a windows serve box

Unfortunately, this generates the following error:

C:\Program Files\dotnet\sdk\6.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(196,5): error NETSDK1032: The RuntimeIdentifier platform 'browser-wasm' and the PlatformTarget 'x64' must be compatible. 

Any clues on how to solve this? I've tested it in another box and it seems to work without any issues.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文