I'm loading an assembly with LoadWithPartialName(), but VS tells me that it's obsolete and to use Load() instead. However, I can't find any convenient overload.
There is a Load(string) with asks for a "full-name" which, if I understood correctly the MSDN docs, includes things like the version number.
There is also a Load (string, Evidence) which accepts a "Display name". The problem is I don't have the slightest idea what the "Display Name" is, as the "Partial Name" I was using with the first function doesn't seem to work.
So, how should it be done?
Reflection. Assembly class. This means that you can pass it to the Get-Member Windows PowerShell cmdlet and see what methods, properties and events are available.
Here's what I did. I am loading "Microsoft.AnalysisServices" into PowerShell as my example.
C:\Windows\Microsoft.NET\assembly\GAC_32
C:\Windows\Microsoft.NET\assembly\GAC_64
C:\Windows\Microsoft.NET\assembly\GAC_MSIL
v4.0_15.0.0.0__89845dcd8080cc91
Now you can create your assembly string.
[System.Reflection.Assembly]::Load("Microsoft.AnalysisServices, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91")
For .NET assemblies, Culture
is always neutral
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With