[GH-ISSUE #84] AngleSharp dependency #28

Closed
opened 2026-02-27 20:30:53 +03:00 by kerem · 3 comments
Owner

Originally created by @panki27 on GitHub (Aug 16, 2023).
Original GitHub issue: https://github.com/Set-OutlookSignatures/Set-OutlookSignatures/issues/84

Originally assigned to: @panki27, @GruberMarkus on GitHub.

After implementing my workaround described in #83, I get another error when trying to set the signature:

      Export to HTM format
        Export high-res images
          The 'DocxHighResImageConversion' feature is reserved for Benefactor Circle members.
          Find out details in '.\docs\Benefactor Circle'.
        Copy HTM image width and height attributes to style attribute
AUSFÜHRLICH: Das in die Pipeline geschriebene Objekt ist eine Instanz vom Typ "mshtml.HTMLDocumentClass" aus der primären Interoperabilitätsassembly der Komponente. Wenn dieser Typ andere Elemente als die
IDispatch-Elemente verfügbar macht, funktionieren Skripts, die dieses Objekt verwenden, möglicherweise nicht, sofern die primäre Interoperabilitätsassembly nicht installiert ist.
        Move CSS inline

Unexpected error. Exit.
Ausnahme beim Abrufen des Elements "MoveCssInline": "Die Datei oder Assembly "AngleSharp, Version=0.16.1.0, Culture=neutral, PublicKeyToken=e83494dcdc6d31ea" oder eine Abhängigkeit davon wurde nicht
gefunden. Das System kann die angegebene Datei nicht finden."
In C:\Users\pankratzf\Desktop\Set-OutlookSignatures_v4.2.0\Set-OutlookSignatures.ps1:3803 Zeichen:53
+ ... xt($path, $([PreMailer.Net.PreMailer]::MoveCssInline($tempFileContent ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], ExtendedTypeSystemException
    + FullyQualifiedErrorId : CatchFromBaseGetMember

So it seems like I'm missing a DLL? Not sure which one or where to get it, though.
Running the script with -MoveCSSInline $false works fine.

Originally created by @panki27 on GitHub (Aug 16, 2023). Original GitHub issue: https://github.com/Set-OutlookSignatures/Set-OutlookSignatures/issues/84 Originally assigned to: @panki27, @GruberMarkus on GitHub. After implementing my workaround described in #83, I get another error when trying to set the signature: ``` Export to HTM format Export high-res images The 'DocxHighResImageConversion' feature is reserved for Benefactor Circle members. Find out details in '.\docs\Benefactor Circle'. Copy HTM image width and height attributes to style attribute AUSFÜHRLICH: Das in die Pipeline geschriebene Objekt ist eine Instanz vom Typ "mshtml.HTMLDocumentClass" aus der primären Interoperabilitätsassembly der Komponente. Wenn dieser Typ andere Elemente als die IDispatch-Elemente verfügbar macht, funktionieren Skripts, die dieses Objekt verwenden, möglicherweise nicht, sofern die primäre Interoperabilitätsassembly nicht installiert ist. Move CSS inline Unexpected error. Exit. Ausnahme beim Abrufen des Elements "MoveCssInline": "Die Datei oder Assembly "AngleSharp, Version=0.16.1.0, Culture=neutral, PublicKeyToken=e83494dcdc6d31ea" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden." In C:\Users\pankratzf\Desktop\Set-OutlookSignatures_v4.2.0\Set-OutlookSignatures.ps1:3803 Zeichen:53 + ... xt($path, $([PreMailer.Net.PreMailer]::MoveCssInline($tempFileContent ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], ExtendedTypeSystemException + FullyQualifiedErrorId : CatchFromBaseGetMember ``` So it seems like I'm missing a DLL? Not sure which one or where to get it, though. Running the script with `-MoveCSSInline $false` works fine.
kerem 2026-02-27 20:30:53 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@GruberMarkus commented on GitHub (Aug 16, 2023):

The message AUSFÜHRLICH: Das in die Pipeline geschriebene Objekt ist eine Instanz vom Typ "mshtml.HTMLDocumentClass" can be ignored, as this is a verbose message which is of informational character, does not hint to an error, and can not be turned off.

The MoveCSSInline error is definitely a bug. I currently can not reproduce it on any of my test systems, but from experience the following code change should solve the problem:

Set-OutlookSignatures.ps1 v4.2.0
Change lines 651-657 from

try {
    Import-Module (Join-Path -Path $script:PreMailerNetModulePath -ChildPath 'PreMailer.Net.dll') -Force -ErrorAction Stop
} catch {
    Write-Host '        Problem importing PreMailer.Net module. Exit.' -ForegroundColor Red
    $error[0]
    exit 1
}

to

@('System.Text.Encoding.CodePages.dll', 'System.Buffers.dll', 'AngleSharp.dll', 'PreMailer.Net.dll') | foreach {
  try {
    Import-Module (Join-Path -Path $script:PreMailerNetModulePath -ChildPath $($_)) -Force -ErrorAction Stop
  } catch {
    Write-Host "        Problem importing PreMailer.Net module ($($_)). Exit." -ForegroundColor Red
    $error[0]
    exit 1
  }
}

If you can confirm that the code change solves the problem, I will include it in the next hotfix release.

<!-- gh-comment-id:1680361983 --> @GruberMarkus commented on GitHub (Aug 16, 2023): The message `AUSFÜHRLICH: Das in die Pipeline geschriebene Objekt ist eine Instanz vom Typ "mshtml.HTMLDocumentClass"` can be ignored, as this is a verbose message which is of informational character, does not hint to an error, and can not be turned off. The MoveCSSInline error is definitely a bug. I currently can not reproduce it on any of my test systems, but from experience the following code change should solve the problem: Set-OutlookSignatures.ps1 v4.2.0 Change lines 651-657 from ``` try { Import-Module (Join-Path -Path $script:PreMailerNetModulePath -ChildPath 'PreMailer.Net.dll') -Force -ErrorAction Stop } catch { Write-Host ' Problem importing PreMailer.Net module. Exit.' -ForegroundColor Red $error[0] exit 1 } ``` to ``` @('System.Text.Encoding.CodePages.dll', 'System.Buffers.dll', 'AngleSharp.dll', 'PreMailer.Net.dll') | foreach { try { Import-Module (Join-Path -Path $script:PreMailerNetModulePath -ChildPath $($_)) -Force -ErrorAction Stop } catch { Write-Host " Problem importing PreMailer.Net module ($($_)). Exit." -ForegroundColor Red $error[0] exit 1 } } ``` If you can confirm that the code change solves the problem, I will include it in the next hotfix release.
Author
Owner

@panki27 commented on GitHub (Aug 16, 2023):

Hi Markus, thanks for the quick reply!
Implementing the suggested change fixes the issue 👍

<!-- gh-comment-id:1680369467 --> @panki27 commented on GitHub (Aug 16, 2023): Hi Markus, thanks for the quick reply! Implementing the suggested change fixes the issue 👍
Author
Owner

@GruberMarkus commented on GitHub (Aug 16, 2023):

My pleasure!

I will close this issue. The code (and adopted clean-up code) will be part of the next hotfix release. It is not yet clear when this will be released, but I would like to to wait for the result of issue #83 and release both fixes in the same version.

<!-- gh-comment-id:1680381299 --> @GruberMarkus commented on GitHub (Aug 16, 2023): My pleasure! I will close this issue. The code (and adopted clean-up code) will be part of the next hotfix release. It is not yet clear when this will be released, but I would like to to wait for the result of issue #83 and release both fixes in the same version.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Set-OutlookSignatures-Set-OutlookSignatures#28
No description provided.