Create a Visual Basic.NET user control following the approach in this article, although it clearly has been translated from Visual C# without testing.
Fix the code and watch it in all it’s beauty. Note, you have to run it from a browser, file paths are not supported.
The problem is, to call into COM objects, I need UnmanagedCode permission. This creates a cascade of further requirements.
Sign the assembly with a strong name.
Create a code group to grant Unrestricted permission.
However, as soon as I sign the assembly, the control won’t load, no matter what.
Unsigned – loads. Signed – won’t load.
I went through the same excercise with C# and everything was smooth.
Not that I’m a fan of VB at all, but let’s say the code base in
question is complicated enough (late bound calls etc.) to justify the use of it.
With the debugger, I found a couple of SecurityExceptions thrown, and one complaint about not allowing partially trusted callers, so I suspect the culprit is either the VisualBasic assembly or one of the WinFX assemblies that somehow magically get loaded.