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

[Bug] Unable to load Google.Apis.Urlshortener.v1.dll in PSGSuite version 2.35.1 #258

Closed
ZamElek opened this issue Jan 8, 2020 · 4 comments
Assignees
Labels
Milestone

Comments

@ZamElek
Copy link

ZamElek commented Jan 8, 2020

Hello, I have troubles with module version 2.35.1:

Summary:
PSGSuite (version 2.35.1) stop working on Microsoft Windows Server 2019 Standard.
To resolve the issue need to upgrade Google.Apis.Urlshortener.v1.dll to Version=1.42.0.0 (but I don't see one at https://www.nuget.org). Probably need rollback *.dlls to version 1.41.1.0

Debugging info:
When I run the command: Import-Module PSGSuite (2.35.1) the errors occurred:

Message: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
StackTrace: at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Microsoft.PowerShell.Commands.AddTypeCommand.LoadAssemblyFromPathOrName(List`1 generatedTypes)
at Microsoft.PowerShell.Commands.AddTypeCommand.EndProcessing()
at System.Management.Automation.CommandProcessorBase.Complete()
LoaderExceptions: System.IO.FileNotFoundException: Could not load file or assembly 'Google.Apis, Version=1.41.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab' or one of i
ts dependencies. The system cannot find the file specified.
File name: 'Google.Apis, Version=1.41.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab'

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
System.IO.FileNotFoundException: Could not load file or assembly 'Google.Apis, Version=1.41.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab' or one of its dependencies.
The system cannot find the file specified.
File name: 'Google.Apis, Version=1.41.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab'
.....

Digging further I have found that it can't load net45/Google.Apis.Urlshortener.v1.dll due to it requires Google.Apis Version=1.41.1.138, but version Google.Apis, Version=1.42.0.0 was installed:
See Fusion logs (https://port135.com/2018/05/17/how-to-enable-assembly-binding-logging-debugging-net-applications/) for more details:

=== Pre-bind state information ===
LOG: DisplayName = Google.Apis, Version=1.41.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab
(Fully-specified)
LOG: Appbase = file:///C:/Windows/System32/WindowsPowerShell/v1.0/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = powershell.exe
Calling assembly : Google.Apis.Urlshortener.v1, Version=1.41.1.138, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab.

LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Google.Apis, Version=1.41.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Google.Apis.DLL.
LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Google.Apis/Google.Apis.DLL.
LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Google.Apis.EXE.
LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Google.Apis/Google.Apis.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/WindowsPowerShell/Modules/PSGSuite/2.35.1/lib/net45/Google.Apis.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Program Files\WindowsPowerShell\Modules\PSGSuite\2.35.1\lib\net45\Google.Apis.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Google.Apis, Version=1.42.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Run-from-source setup phase failed with hr = 0x80131040.
LOG: Attempting download of new URL file:///C:/Program Files/WindowsPowerShell/Modules/PSGSuite/2.35.1/lib/net45/Google.Apis/Google.Apis.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/WindowsPowerShell/Modules/PSGSuite/2.35.1/lib/net45/Google.Apis.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/WindowsPowerShell/Modules/PSGSuite/2.35.1/lib/net45/Google.Apis/Google.Apis.EXE.
LOG: All probing URLs attempted and failed.

@scrthq
Copy link
Member

scrthq commented Jan 8, 2020

hey @ZamElek - Good catch! The URL Shortener API was actually shut down by Google last year, so those should really be pulled out of the module altogether.

Keeping this open until they're pulled out!

@scrthq scrthq self-assigned this Jan 8, 2020
@scrthq scrthq added the bug label Jan 8, 2020
@ZamElek
Copy link
Author

ZamElek commented Jan 9, 2020

Thanks for quick response. I've just replaced *. dll from previous versions :)

@scrthq
Copy link
Member

scrthq commented Jan 22, 2020

Got it @ZamElek ! I'll get this pulled out in the next release =]

@scrthq scrthq added this to the 2.36.0 milestone Jan 22, 2020
@ZamElek
Copy link
Author

ZamElek commented Jan 22, 2020

Thank you!

@scrthq scrthq mentioned this issue Feb 28, 2020
@scrthq scrthq closed this as completed in daaae47 Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants