question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Microsoft.Extensions.DependencyInjection.Abstractions.dll already loaded due to Omnisharp dependencies

See original GitHub issue

I’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

Exception             : 
    Message    : Assembly with same name is already loaded
    TargetSite : 
        Name          : Bind_LoadAssemblies
        DeclaringType : System.Management.Automation.Runspaces.InitialSessionState
        MemberType    : Method
        Module        : System.Management.Automation.dll
    StackTrace : 
   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)
    Source     : System.Management.Automation
    HResult    : -2146232799
CategoryInfo          : InvalidOperation: (:) [Import-Module], FileLoadException
FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand
InvocationInfo        : 
    MyCommand        : Import-Module
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 20
    Line             : ipmo az.resources
    PositionMessage  : At line:1 char:1
                       + ipmo az.resources
                       + ~~~~~~~~~~~~~~~~~
    InvocationName   : ipmo
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:57 (21 by maintainers)

github_iconTop GitHub Comments

5reactions
rjmholtcommented, Nov 26, 2019

I’ve made some progress here:

asm

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.

2reactions
rjmholtcommented, Nov 7, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found