GetSslCertificateBindings error in Visual Studio

16 views
Skip to first unread message

mcwh...@gmail.com

unread,
Jan 24, 2019, 3:26:05 PM1/24/19
to Carbon
Hey all,

I'm using Carbon inside of Visual Studio to set up IIS websites for localhost development.  I'm using a Visual Studio add-in to execute a powershell script after a project builds.  Everything works great except SSL bindings in IIS.

When I run this in a PS window or ISE, it works without error, but for some reason inside of this VS add-in, I get an exception thrown from GetSslCertificateBindings which is in the Carbon.dll

Get-CSslCertificateBinding : Exception calling "GetSslCertificateBindings" with "0" argument(s): "The operation 
completed successfully"
At C:\Program Files (x86)\WindowsPowerShell\Modules\Carbon\2.7.0\Functions\Test-SslCertificateBinding.ps1:63 char:16
+     $binding = Get-CSslCertificateBinding @getArgs
+                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-CSslCertificateBinding], MethodInvocationException
    + FullyQualifiedErrorId : Win32Exception,Get-CSslCertificateBinding

Any thoughts on what might be the issue?  When the powershell gets executed, the add-in invokes powershell.exe with these arguments: "-ExecutionPolicy Bypass -NonInteractive -File Build\\Local.ps1"

The actual Carbon function inside Local.ps1 looks like this:

Set-IisWebsiteSslCertificate -SiteName $Name -Thumbprint $Thumbprint -ApplicationID "88d1f8da-aeb5-40a2-a5e5-0e6107825df7"

Any thoughts?  Since this is only happening for SSL (and inside Visual Studio), there might be some COM or Security things happening here.

Thanks,

Mark

Aaron Jensen

unread,
Jan 24, 2019, 4:16:13 PM1/24/19
to mcwh...@gmail.com, Carbon
That's very strange. Is this being run as part of a pre/post-build step in a .csproj file? What's the best way for me to reproduce this locally?

--
You received this message because you are subscribed to the Google Groups "Carbon" group.
To unsubscribe from this group and stop receiving emails from it, send an email to carbonps+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/carbonps/b6a82d63-6ff8-45c7-92da-0e319c27b4c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mcwh...@gmail.com

unread,
Jan 24, 2019, 8:16:43 PM1/24/19
to Carbon
Aaron,

After some investigation, it appears that the powershell script is being launched in Visual Studio from a 32bit process instead of 64.  So, it made me wonder if the COM components were only registered for 64.  When I swapped out Carbon for WebAdministration module, I got this error:

Retrieving the COM class factory for component with CLSID 
{688EEEE5-6A7E-422F-B2E1-6AF00DC944A6} failed due to the following error: 80040154 Class not registered 

I "hacked" up the add-in to force a 64bit process and I was able to successfully use Carbon functions for SSL along with WebAdministration.  I've reached out to the author to help shed some light on the options within Visual Studio. So, I can't definitively say I have a solution, but at least a workaround.  I wanted you to be aware along with anybody else that might come across something like this.

Once I get a working solution, I will post it here.

Thanks,

Mark
Reply all
Reply to author
Forward
0 new messages