skip to Main Content

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 SERVERFile ServerAppName. 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.

2

Answers


  1. Chosen as BEST ANSWER

    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!


  2. The error message indicates that there’s an "Invalid URI" exception being thrown during the publishing process.

    You could try the following steps:

    1.Check Publish Profile Settings: Ensure that your publish profile settings in Visual Studio are correctly configured, including the target location and any other settings related to the publish process. Verify that the target location SERVERFile ServerAppName is accessible and has the necessary permissions.

    2.Review your project files (.csproj, .sln, etc.) to ensure that there are no incorrect or malformed URIs specified.

    3.Check External Dependencies: If your project relies on external resources or dependencies (such as databases, files, or web services), ensure that all URIs or file paths are correctly configured and accessible.

    4.Verify File References: Review your project files (.csproj, .config, etc.) to check for any hardcoded or dynamic URIs that might be causing the issue. Ensure that all references are valid and properly formatted.

    5.Publish in Debug Mode: Try publishing the application in debug mode to see if you can capture more detailed information about the error.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search