Microsoft.Extensions.DependencyInjection.Abstractions.dll already loaded due to Omnisharp dependencies
See original GitHub issueI’m running 2019.11.1 (the out of band fix for the @ problem #2274 ) and cannot import Az.Resources anymore as a dll is already loaded. It still imports fine outside of the integrated terminal so I’m curious if something changed in this release that might cause this?
PSVersion
Name Value
---- -----
PSVersion 7.0.0-preview.5
PSEdition Core
GitCommitId 7.0.0-preview.5
OS Darwin 19.0.0 Darwin Kernel Version 19.0.0: Thu Oct 17 16:17:15 PDT 2019; root:xnu-6153.41.3~29/RELEASE_X86_64
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Loaded Modules:
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Manifest 7.0.0.0 Microsoft.PowerShell.Management {Add-Content, Clear-Content, Clear-Item, Clear-ItemProperty…}
Manifest 7.0.0.0 Microsoft.PowerShell.Security {ConvertFrom-SecureString, ConvertTo-SecureString, Get-Credential, Get-ExecutionPolicy…}
Manifest 7.0.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object…}
Script 2.0.325 oh-my-posh {Get-ComputerName, Get-Drive, Get-FullPath, Get-ShortPath…}
Script 0.7.3 posh-git {Add-PoshGitToProfile, Add-SshKey, Enable-GitColors, Expand-GitCommand…}
Script 0.2.0 PowerShellEditorServices.Commands {ConvertFrom-ScriptExtent, ConvertTo-ScriptExtent, Find-Ast, Get-Token…}
Binary 0.2.0 PowerShellEditorServices.VSCode {Close-VSCodeHtmlContentView, New-VSCodeHtmlContentView, Set-VSCodeHtmlContentView, Show-VSCodeHtmlContentView…}
Script 2.0.0 beta5 PSReadLine {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler…}
Trying to load Az.Resources
[1;32mException : [0m
[1;32mMessage : [0mAssembly with same name is already loaded
[1;32mTargetSite : [0m
[1;32mName : [0mBind_LoadAssemblies
[1;32mDeclaringType : [0mSystem.Management.Automation.Runspaces.InitialSessionState
[1;32mMemberType : [0mMethod
[1;32mModule : [0mSystem.Management.Automation.dll
[1;32mStackTrace : [0m
at System.Management.Automation.Runspaces.InitialSessionState.Bind_LoadAssemblies(ExecutionContext context)
at System.Management.Automation.Runspaces.InitialSessionState.Bind(ExecutionContext context, Boolean updateOnly, PSModuleInfo module, Boolean noClobber, Boolean local, Boolean setLocation)
at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleManifest(String moduleManifestPath, ExternalScriptInfo manifestScriptInfo, Hashtable data, Hashtable localizedData, ManifestProcessingFlags manifestProcessingFlags, Version minimumVersion, Version maximumVersion, Version requiredVersion, Nullable`1 requiredModuleGuid, ImportModuleOptions& options, Boolean& containedErrors)
[1;32mSource : [0mSystem.Management.Automation
[1;32mHResult : [0m-2146232799
[1;32mCategoryInfo : [0mInvalidOperation: (:) [Import-Module], FileLoadException
[1;32mFullyQualifiedErrorId : [0mFormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand
[1;32mInvocationInfo : [0m
[1;32mMyCommand : [0mImport-Module
[1;32mScriptLineNumber : [0m1
[1;32mOffsetInLine : [0m1
[1;32mHistoryId : [0m20
[1;32mLine : [0mipmo az.resources
[1;32mPositionMessage : [0mAt line:1 char:1
+ ipmo az.resources
+ ~~~~~~~~~~~~~~~~~
[1;32mInvocationName : [0mipmo
[1;32mCommandOrigin : [0mInternal
[1;32mScriptStackTrace : [0mat <ScriptBlock>, <No file>: line 1
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:57 (21 by maintainers)
Top Results From Across the Web
c# - Could not load file or assembly Microsoft.Extensions ...
Error message: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=3.1.9.0.
Read more >could not load file or assembly 'system.runtime.interopservices ...
1) first, try to add the related dll into the system global assembly caches. ; 2) close VS, delete .vs hidden folder under...
Read more >omnisharp-vscode - Discover .NET
Official C# support for Visual Studio Code (powered by OmniSharp) ... csproj projects on Windows, macOS and Linux. The C# extension is powered...
Read more >Blazor WebAssembly 3.2.0 Preview 3 release now available
2\Microsoft.Extensions.Hosting.Abstractions.dll'. 'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared ...
Read more >ASP.NET Core MVC
Any text editor (VS Code, Emacs, Sublime, etc) and OmniSharp (OSS) ... Install NuGet dependencies. • Build application. • Load .NET and run...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’ve made some progress here:
Still work to do (1) investigating and implementing solutions in .NET Framework, and (2) migrating the rest of our startup logic to C#, since I had to rewrite it all to set the load order in stone.
Looks like it’s Primitives + DI.Abstractions – the Omnisharp LSP library depends on them.
We’ll need to investigate a workaround for the dependency hell issue. We’ve already discussed pushing the LSP work into another thread or process in a different issue, but that was also deemed to be too breaking due to argument completers and static class bits not working.