Skip to content

debug.fail fail when publishing a ClickOnce application using Debug MSBuild #4983

Open
@Forgind

Description

@Forgind

Steps to reproduce

Use a version of MSBuild built in debug mode. To make such a version:

  1. Open an administrator command prompt
  2. Switch to powershell by invoking powershell.exe
  3. set-executionpolicy
  • unrestricted
  1. From the msbuild folder, run .\script\Deploy-MSBuild.ps1 -configuration Debug -destination <the folder with your version of Visual Studio, i.e., C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\>

Note This overwrites some of your MSBuild binaries. To restore them, copy them from the newly created Backup-<datetime> folder.

Then run these steps:

  1. Create a project, such as WPF/Winforms project.
  2. Right click on Reference open Manage NuGet Packages…
  3. Click Settings and set the package management format to PackageReference .
  4. Install a NuGet package such as Newtonsoft.Json.
  5. Publish and install the project.
  6. On Signing page uncheck the 'Sign the ClickOnce manifests'.
  7. Publish the project.

Expected behavior

It opens an explorer window from which you can run setup.exe. Doing so (and installing it) fails because of #4824.

Actual behavior

Fails before it gets there with this error:

---------------------------
Assertion Failed: Abort=Quit, Retry=Debug, Ignore=Continue
---------------------------
Validation results have already been added for culture '{0}' en at Microsoft.Build.Tasks.Deployment.Bootstrapper.ProductValidationResults.AddPackageResults(String culture, XmlValidationResults results)
   at Microsoft.Build.Tasks.Deployment.Bootstrapper.BootstrapperBuilder.ExploreDirectory(String strSubDirectory, XmlElement rootElement)
   at Microsoft.Build.Tasks.Deployment.Bootstrapper.BootstrapperBuilder.RefreshProducts()
   at Microsoft.Build.Tasks.Deployment.Bootstrapper.BootstrapperBuilder.Refresh()
   at Microsoft.Build.Tasks.Deployment.Bootstrapper.BootstrapperBuilder.get_Products()
   at Microsoft.VisualStudio.Publish.BaseProvider.BootstrapperManager.GetProducts()
   at Microsoft.VisualStudio.Publish.ClickOnceProvider.BuildManager.GetBootstrapperProducts()
   at Microsoft.VisualStudio.Publish.BaseProvider.BootstrapperProperties.LoadBootstrapperProducts()
   at Microsoft.VisualStudio.Publish.BaseProvider.BootstrapperProperties.GetDefaultBootstrapperItems()
   at Microsoft.VisualStudio.Publish.BaseProvider.BootstrapperProperties.Reset()
   at Microsoft.VisualStudio.Publish.BaseProvider.BootstrapperProperties..ctor(ProductGetterDelegate ProductGetter, ProjectKind ProjectKind, PublishProvider PublishProvider)
   at Microsoft.VisualStudio.Publish.ClickOnceProvider.PublishProperties..ctor(PublishProvider provider)
   at Microsoft.VisualStudio.Publish.ClickOnceProvider.PublishProvider..ctor(IPublishManager PublishManager)
   at Microsoft.VisualStudio.Publish.Framework.PublishFactory.CreateProvider(IPublishManager publishManager, String context)
   at Microsoft.VisualStudio.Publish.Framework.PublishManager..ctor(Project project, IVsCfgProvider cfgProvider, String context)
   at Microsoft.VisualStudio.Publish.Framework.PublishProject.SetObjects(Object obj, IVsCfgProvider cfgProvider, String Context)
---------------------------
Abort   Retry   Ignore   
---------------------------

This appears when debug.fail is fallaciously called. This may be a signal that something else is wrong, or it's possible that the check is simply too aggressive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: TasksIssues impacting the tasks shipped in Microsoft.Build.Tasks.Core.dll.triaged

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions