While our PowerShell was version 5.x, the code that used Spire.DLL objects worked. However, when we upgraded to 7.x, the program started giving errors.
The code is as follows:
----------------------------
[Spire.License.LicenseProvider]::SetLicenseKey("xxx") // License key not displayed here
$doc = New-Object -TypeName Spire.Doc.Document
$lic = New-Object -TypeName Spire.License.LicenseProvider
$srcFileWithPath = $global:downloadFolder + "\" + $srcfile
$doc.LoadFromFile($srcFileWithPath)
-----------------------------
After the upgrade, the LoadFromFile statement gives the following error. Please not that this same code works with PowerShell 5.x.
The following exception occurred while retrieving member "LoadFromFile": "Could not load type 'System.Web.HttpResponse' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral,
| PublicKeyToken=b03f5f7f11d50a3a'."
Thanks.