Skip to content
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

Could not load file or assembly 'System.Net.Http, Version=4.2.0.0 #92

Open
ftroot opened this issue Aug 31, 2023 · 4 comments
Open

Could not load file or assembly 'System.Net.Http, Version=4.2.0.0 #92

ftroot opened this issue Aug 31, 2023 · 4 comments

Comments

@ftroot
Copy link

ftroot commented Aug 31, 2023

Hi all,

Here is the full log:

`...
VERBOSE: ModuleVersion: 3.2.0
PS>TerminatingError(Get-ConnectionContext): "Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified."
VERBOSE: ConnectionContext Removed
PS>TerminatingError(): "Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified."
PS>TerminatingError(Write-Log): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to fetch Global Address List Contacts from Office 365 Directory"

TerminatingError(Write-Log): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to fetch Global Address List Contacts from Office 365 Directory"
TerminatingError(Write-Log): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to fetch Global Address List Contacts from Office 365 Directory"
TerminatingError(Write-Log): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to fetch Global Address List Contacts from Office 365 Directory"
The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to fetch Global Address List Contacts from Office 365 Directory
Write-Log : Failed to fetch Global Address List Contacts from Office 365 Directory
At line:85 char:3

  •     Write-Log -Level "FATAL" -Message "Failed to fetch Global Add ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-Log

Windows PowerShell transcript end
End time: 20230831142326
**********************`


After Googling on this error, it seems to be a version conflict. See here for example.

I'm running the script on PowerShell 7.3.0 (Windows Server 2016). The .dll files are not blocked.
Thanks for any idea as I just don't know what I'm suppose to do now...

@hxcde
Copy link

hxcde commented Sep 15, 2023

Same Error

Write-Log : Failed to fetch Global Address List Contacts from Office 365 Directory
In Zeile:85 Zeichen:3
Write-Log -Level "FATAL" -Message "Failed to fetch Global Add ... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-Log

The old version stopped working some weeks ago, so we tried to update the script.

@grahamr975
Copy link
Owner

@ftroot @hxcde

I'm using powershell 6 & have not tested using powershell 7. Could you try downgrading to see if this resolves your issue?

@hxcde
Copy link

hxcde commented Sep 20, 2023

@ftroot @hxcde

I'm using powershell 6 & have not tested using powershell 7. Could you try downgrading to see if this resolves your issue?

Still the same error with Powershell Version 6.27

@ftroot
Copy link
Author

ftroot commented Sep 28, 2023

@ftroot @hxcde

I'm using powershell 6 & have not tested using powershell 7. Could you try downgrading to see if this resolves your issue?

Any chance to have this script work on PS 7 ?
Would be great if you could consider adapting the script as PS7 is now the default release with the one-liner tool.
Thanks a lot in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants