-
Notifications
You must be signed in to change notification settings - Fork 490
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
Conflict with the .Net dll of the Az module #3012
Comments
Could you include the output of |
@SeeminglyScience I can do even more :-)
|
Thanks! Can you see if it repros with the latest PowerShell 7.1 preview? That looks like the (fixed) PowerShell bug where it would try to load assemblies unnecessarily because they are listed in the |
@SeeminglyScience No way, the same also with Powershell 7.1 preview Repro: |
If you can provide the information requested in the issue template, that would be helpful |
System Details Output
Issue DescriptionI am experiencing a problem running Az module commands within VS Code powershell terminal Expected BehaviourRunning the command Actual BehaviourThis error appears
|
hmmmm @sgiovinetti did you get the same error manually importing the module with RC-1? Also do you have anything in your PowerShell profile or settings? |
@SydneyhSmith : did you get the same error manually importing the module with RC-1? YES |
Thanks @sgiovinetti to get your PowerShell profile you can run |
@SydneyhSmith
|
Try |
@rjmholt I don't think they need to do that. This proves there's nothing in the profile that could be showing this behavior. |
I am intrigued by the path not being a full path... That looks like it could cause issues based on what the current working directory is in relation to what drive you're on 😬 Out of curiosity: what does |
@sgiovinetti I believe what Sydney was saying was try |
I checked the settings.json and there is nothing there about powershell except |
🤔 it's interesting that your User profiles are missing the Documents directory... The profile is usually stored in the PowerShell directory of: C:\Users\corbob> [environment]::GetFolderPath("MyDocuments")
C:\Users\corbob\OneDrive\Documents
C:\Users\corbob> $profile | select *
AllUsersAllHosts : C:\Program Files\PowerShell\7\profile.ps1
AllUsersCurrentHost : C:\Program Files\PowerShell\7\Microsoft.PowerShell_profile.ps1
CurrentUserAllHosts : C:\Users\corbob\OneDrive\Documents\PowerShell\profile.ps1
CurrentUserCurrentHost : C:\Users\corbob\OneDrive\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
Length : 78 Of course this is probably secondary to the originally reported issue... |
@corbob : one detail that perhaps could be important. Our IT has setup the laptop so that the windows user settings reside on a mapped drive (NAS) that is not available when we work from home. I notice that when I connect to my company with the VPN and the mapped drive becomes available the vscode powershell intellisense tries to search for libraries on the mapped drive. I guess the issue is in the vscode extension intellisense, I guess intellisense is trying to load some .net libraries located somewhere on my laptop or on network that goes in conflict with the Az module. In fact I noticed that randomly, trying to open a fresh vs-code closing all the .ps files tab and opening a brand new empty .ps file sometimes it works. |
So looking at things, it seems like two of the same assembly are somehow being loaded and the first one prevents the second one, which is the one from Az.Accounts, from being loaded. The big question to my mind is: why and where is the first version of the assembly loaded and where from? A couple of things that would help us answer that question:
|
@rjmholt : the loading error is clearly shown on the third message from the top. The conflicting module is FusionLog. I will work on activating the diagnostic logs extension so I can provide you more details. |
That's only part of the error I'm afraid. Try
Actually that's not a module. You can see there's no such module given in |
It looks like removing the obsolete Azure repos extension solved the issue but I will continue to investigate |
This issue is being closed as inactive, if this issue is still occurring it will be re-opened |
If I run with extension enabled this code (and a lot of others Az commands):
Connect-AzAccount
I receive the following error:Connect-AzAccount: The 'Connect-AzAccount' command was found in the module 'Az.Accounts', but the module could not be loaded. For more information, run 'Import-Module Az.Accounts'.
Running the same code without the extension works perfectly. I guess this extension reference some .NET libraries that goes in conflict with the .NET libraries used in Az.Accounts module
Here the modules i have installed:
The text was updated successfully, but these errors were encountered: