by
455 17
0
6
1,225
0
Top 1% !
Popular
Famous
Tagged
Specified
OpenSource
Popularity: 33573rd place

Published on:

Languagevb.net

Replace Assembly.LoadWithPartialName with Assembly.Load

The Assembly.LoadWithPartialName has been deprecated. From now on you have to use Assembly.Load
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/1622502/Replace-Assembly-LoadWithPartialName-wit?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
'###Till .NET Framework 2.0 you can Load an assembly by its name Dim FormsAssembly As Reflection.Assembly = Reflection.Assembly.LoadWithPartialName("System.Windows.Forms") '###After .Net Framework 2.0 you have to use Assembly.Load '###Therefore you have to give all the assembly information but the public token is not the same per pc Dim FormsAssembly As Reflection.Assembly = Reflection.Assembly.Load("System.Windows.Forms, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = 7a84f7ac56134e3a") '###In order to bypass this wall either you retrieve it from the registry or you use the GetType(Form) for the retrieval. Dim AssemblyLoadString As String = GetType(Form).AssemblyQualifiedName.ToString.Substring(GetType(Form).AssemblyQualifiedName.ToString.IndexOf(",") + 2) Dim FormsAssembly As Reflection.Assembly = Reflection.Assembly.Load(AssemblyLoadString)
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus