tkm65
tkm65

Reputation: 1

WPF OneClick application build successful, but Publish fails in Visual Studio 2022

I've been maintaining a desktop WPF application that uses OneClick for several years. I'm currently using Visual Studio 2022.

Recently, I've updated the application so that it uses .NET 8 and EF Core. The application builds and runs in Visual Studio without obvious issues.

When I try to "Publish" the OneClick application, the build succeeds, but the Publish fails --

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.

I don't see any other warning in the output window other than some StyleCop complaints, but I get a "Publish Failed" error each time.

I've noticed that I get a URI error that shows up in the Event Log each time -

The following information was included with the event:

(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

The path that I'm publishing to looks like this \SERVER\File Server\AppName. That's been the same path that I've used for years.

The resulting "log" file looks like this:

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. 

Huh? Does anyone know why this might be happening? Or how I can determine what the offending URI is?

I've tried resolving the warnings that I was seeing in the build output and I've resolved all but StyleCop warnings. This doesn't seem to help.

I've tried placing a breakpoint in the System.URI class while building in DEBUG mode, but the code that does work of building and publishing doesn't break on the breakpoint.

Increasing the verbosity and redirecting the output of the ClickOnce logs, as recommended at https://learn.microsoft.com/en-us/visualstudio/deployment/how-to-set-a-custom-log-file-location-for-clickonce-deployment-errors?view=vs-2022 and https://learn.microsoft.com/en-us/visualstudio/deployment/how-to-specify-verbose-log-files-for-clickonce-deployments?view=vs-2022 , but I don't actually get any log files at the directory I specify.

Upvotes: 0

Views: 452

Answers (1)

tkm65
tkm65

Reputation: 1

The root cause of my publishing issue is still a mystery, but Hui Liu's recommendations regarding dependencies helped.

I "rolled back" many recent nuget package updates and found that the application published normally after doing so. Through process of elimination I was able to find that not updating Microsoft.Extenstions.Logging.Console allowed me to publish my OneClick application normally. I had been on version 7, while version 8 appeared to cause publish errors.

Thank You, Hui Liu!

Upvotes: 0

Related Questions