Same assembly was loaded into multiple contexts of an application domain
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Bug
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- powershell, typescript
- Bereich
- tooling
Rechercherichtung
Beginne damit, die Warnung mit Fuslogvw.exe, Windows PowerShell und den im Issue beschriebenen Schritten zur Aktivierung der Erweiterung zu reproduzieren. Untersuche, wie PSScriptAnalyzer und PowerShellEditorServices ihre Newtonsoft.Json-Assemblies laden, und ermittle anschließend, ob die doppelten Kontexte beabsichtigt sind oder die gemeldeten Modulfehler verursachen. Erledigt ist die Aufgabe, wenn eine bestätigte Ursache und eine vereinbarte Lösung oder Erklärung dokumentiert sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Prerequisites
- I have written a descriptive issue title.
- I have searched all open and closed issues to ensure it has not already been reported.
- I have read the troubleshooting guide.
- I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
- I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
- If this is a security issue, I have read the security issue reporting guidance.
Summary
When opening a Windows PowerShell (x64) session in the embedded VSCode terminal, I found an error in fusion log (assembly binding log) saying Newtonsoft.Json was "loaded into multiple contexts of an application domain" and "might lead to runtime failures". I am not sure if this caused modules such as "Az.Accounts" behaving incorrectly in this session (see Not able to connect to Azure with Az.Accounts version 2.12.3 (get_SerializationSettings) from within Visual studio code), but please review the design and let us know if it's intentional or not.
Fusion log:
*** Assembly Binder Log Entry (2025/1/20 @ 10:09:44 AM) ***
The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
--- A detailed error log follows.
WRN: The same assembly was loaded into multiple contexts of an application domain:
WRN: Context: LoadFrom | Domain ID: 1 | Assembly Name: Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
WRN: Context: Neither | Domain ID: 1 | Assembly Name: Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
WRN: This might lead to runtime failures.
WRN: It is recommended to inspect your application on whether this is intentional or not.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
These are the two Newtonsoft.Json assemblies that are loaded to the session, one net45 from PSScriptAnalyzer, another netstandard2.0 from PowerShellEditorServices.
FullName : Newtonsoft.Json, Version=13.0.0.0, Culture=neutral,
PublicKeyToken=30ad4fe6b2a6aeed
Location : C:\Users\yeliu\.vscode\extensions\ms-vscode.powershell-2024.4.0\
modules\PSScriptAnalyzer\1.23.0\Newtonsoft.Json.dll
AssemblyFileVersion : 13.0.3.27908
TargetFramework : .NETFramework,Version=v4.5
FullName : Newtonsoft.Json, Version=13.0.0.0, Culture=neutral,
PublicKeyToken=30ad4fe6b2a6aeed
Location : C:\Users\yeliu\.vscode\extensions\ms-vscode.powershell-2024.4.0\
modules\PowerShellEditorServices\bin\Common\Newtonsoft.Json.dll
AssemblyFileVersion : 13.0.3.27908
TargetFramework : .NETStandard,Version=v2.0
PowerShell Version
Name Value
---- -----
PSVersion 5.1.26100.2161
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.26100.2161
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Name : Visual Studio Code Host
Version : 2024.4.0
InstanceId : 1f8d7bfb-7399-4b83-a114-5d5cfa983ec5
UI : System.Management.Automation.Internal.Host.InternalHostUserInterfac
e
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
Visual Studio Code Version
1.96.4
cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
x64
Extension Version
ms-vscode.powershell@2024.4.0
Steps to Reproduce
- Open Fuslogvw.exe (Assembly Binding Log Viewer) and enable "Log all bindings in disk" in the settings - https://learn.microsoft.com/en-us/dotnet/framework/tools/fuslogvw-exe-assembly-binding-log-viewer
- Open a
.ps1script to activate the extension - Open a integrated terminal of Windows PowerShell (x64)
- You should be able to find an entry like "LoadFile!FileName=(Newtonsoft.Json.dll)", the warning message is in it.
Visuals
No response
Logs
No response
- Vorherrschende Sprache
- TypeScript
- Sterne
- 1.9k
- Forks
- 548
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PowerShell/vscode-powershell
-
agentic-workflows
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
PowerShell/vscode-powershell#5599 · 3 Kommentare ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
PowerShell/vscode-powershell#5592 · 2 Kommentare · 1 Reaktion ·
-
agentic-workflows
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
PowerShell/vscode-powershell#5583 · 1 Kommentar ·
-
powershell.scriptAnalysis.settingsPath (Description): Warning Message Should Provide A Workaround OffenArea-Code Formatting Issue-Enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
PowerShell/vscode-powershell#4653 · 3 Kommentare · 4 Reaktionen ·
-
nothing OffenIssue-Bug Needs: Triage
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 5/100
PowerShell/vscode-powershell#5603 · 1 Reaktion ·
Alle Issues in PowerShell/vscode-powershell
Ähnliche Issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 76/100
-
code-quality refactoring
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
langchain-ai/deepagents#6450 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
vercel/react-tweet#225 ·