Unable to publish build through Visual Studio

Unable to publish Vishual Studio code to Azure, prompting to certificate issue.

Certificate error:
image

I have tried adding trusted allow trusted hosts in .pubxml file also imported certificate. Still it is not working.

Publishing build requires any additional ports to be allowed for Azure in Zscaler. Kindly suggest me.

I don’t have VS to test with, but this thread from Stack Overflow looks promising


The option to allow untrusted certificates is not yet supported in the current tooling. Hopefully, this gets updated very soon. You can, however, set it manually.

  1. Open the publish profile file ( .pubxml ) inside /Properties/PublishProfiles in a text editor
  2. Inside the <PropertyGroup> element, set AllowUntrustedCertificate to True ( <AllowUntrustedCertificate>True</AllowUntrustedCertificate> ) or add it if it doesn’t exist
  3. Set UsePowerShell to False ( <UsePowerShell>False</UsePowerShell> ).

At this time of writing, the generated powershell script disregards the AllowUntrustedCertificate property which is probably a bug, hence, the need to set it to False .

You can get powershell to work if you update the module version in the .ps1 file.

As a side note, you can also get around this problem by “trusting” the server’s certificate locally.

Hi Scott,

I tired this option from stack overflow site earlier, it is not working. Kindly let me know if you have any other option to import certificate locally.

Disabling the Revocation-status-checking is fairly easy (just use the advanced tab in the internet options via the control panel).

However, visual studio has a variety of other problems when the zscaler proxy is used. Publishing websites doesn’t work, and it fails for me with 500 status codes (internal errors). We’ve been trying (and failing) to go thru the zscaler proxy for a couple of years. Unless zscaler wants to deliberately work with Microsoft on their Visual Studio compatibility, I think it best to bypass the proxy as suggested by Microsoft at the following link:

This “bypass” approach/workaround is the same when using Fiddler (which is also capable of doing ssl inspection). Whenever developers encounter HTTPS failures in VS, they just close Fiddler to get things to start working again!