-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Console sink throws error on initialization when used in VSCode PS integrated console preview #3
Comments
After spening couple of hours trying to find out what is going on, I unfotunately did not find the root cause. The issue is definitely connected to VS Code as this issue shows only there. I tryed powershell 5.1, 7.0, x86 and x64 versions, outside VS Code and everything worked like charm. [appdomain]::currentdomain.getassemblies() | ?{$_.CodeBase -match "Console"} and I noticed that
So I opened
to add Edit #Note that you should be running PowerShell as an Administrator
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall("C:\Path\To\DLL.dll") |
For anyone that needs a quick resolution to this, as of v2.1.1 use the following: #Note that you should be running PowerShell as an Administrator
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall("C:\Program Files\WindowsPowerShell\Modules\PoShLog\2.1.1\lib\Serilog.Sinks.Console.dll")
$publish.GacInstall("C:\Program Files\WindowsPowerShell\Modules\PoShLog\2.1.1\lib\Serilog.Sinks.File.dll")
$publish.GacInstall("C:\Program Files\WindowsPowerShell\Modules\PoShLog\2.1.1\lib\Serilog.dll") |
Hi there
First up, cool module you have here!
I ran into following error upon installing v 2.0.0 from powershellgallery,
and trying to use it in VSCodes Powershell integrated console:
(PowerShell 5.1, Server 2016,
=====> PowerShell Preview Integrated Console v2020.6.1 <=====)
It works in the normal console tho
The text was updated successfully, but these errors were encountered: