You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VS2022中WPF ClickOnce应用构建成功但发布失败求助

ClickOnce发布失败(.NET 8升级后)

我维护一款使用ClickOnce部署的WPF桌面应用已有数年,当前使用Visual Studio 2022。近期将应用升级为.NET 8+EF Core后,应用在VS中构建、运行均无明显问题,但执行ClickOnce发布时,构建成功但发布失败。

发布输出信息

8>CompilerServer: server - server processed compilation - 1b3eb992-ddfe-4b23-a907-e19f9bb6532a
Build: 7 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Build completed at 3:13 PM and took 51.644 seconds ==========
Publish: 0 succeeded, 1 failed, 0 skipped ==========
Publish completed at 3:13 PM and took 51.644 seconds ==========
Visual Studio accelerated 1 project(s), copying 12 file(s). See https://aka.ms/vs-build-acceleration.

输出窗口除StyleCop警告外无其他提示,但每次发布都会显示“Publish Failed”错误。

事件日志中的URI格式错误

(devenv.exe, PID 15072, Thread 1) IdleProcessorManager.DoWork - Job threw:
Invalid URI: The format of the URI could not be determined. at
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at Microsoft.VisualStudio.TestTools.TestCaseManagement.SolutionIntegrationManager.IsRunConfig(String filename)
   at Microsoft.VisualStudio.TestTools.TestCaseManagement.SolutionIntegrationManager.<AddSolutionFilesRunConfigsToTmi>d__351.MoveNext()
   at Microsoft.VisualStudio.TestTools.TestCaseManagement.IdleProcessorManager.DoWork()

The message resource is present but the message was not found in the message table

发布路径为\\SERVER\File Server\AppName,该路径已使用多年。

生成的日志文件内容

System.AggregateException: One or more errors occurred. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details. 
   --- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details. <---

Microsoft.WebTools.Shared.Exceptions.WebToolsException: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details. 

已尝试的解决方法

  • 解决除StyleCop外的所有构建警告
  • 在System.Uri类中设置断点
  • 增加ClickOnce日志详细度并指定输出目录

以上操作均未解决问题或获取有效日志。

求助问题

该问题可能原因是什么?如何定位错误URI?


内容的提问来源于stack exchange,提问作者tkm65

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.24 16:02:43