Fan Spam

July 27, 2011

All these comments originated from 109.230.246.23 (utrace, dnsstuff) and were posted on my Products page:

What an exciting article, preserve writing companion

Sweetheart, this site is without a doubt fabolous, i simply like it

hi there, your website is wonderful. We do thank you for job

Sweetheart, this amazing site can be fabolous, i recently fantastic

How much of an intriguing posting, keep producing better half

How much of an important article, continue to keep creating mate

What an unique posting, continue to keep crafting special someone

… accidentally, of course, naming a web address ending in .pl.

See this WordPress Support page on how to disable comments on your Pages, if you are hit by similar spam.


Resolving Assembly Bindings in Powershell

July 2, 2011

After configuring PowerShell to use an assembly’s config file and successfully loading assemblies and their dependencies, I found that assemblies referenced by the assembly’s config file were not found by the loader, even though the same referenced assemblies were already loaded by the original assembly.

To understand what is going on during Assembly.Load and Assembly.LoadFrom, read this MSDN article explaining the different Load Contexts that .Net uses for the various Assembly.Load*** methods.

This answer on StackOverflow provides C# code implementing the AssemblyResolve event for the current AppDomain to retrieve assemblies that the runtime does not find directly.

The original code stores a list of assembly names and their actual paths, and the AssemblyResolver class loads an assembly if it is found in this list.

I added code to handle binding assemblies in pre-defined paths, and posted the resulting code under the AssemblyResolver package here.

To use this assembly resolver in PowerShell, first load the assembly containing the assembly resolver, define known assemblies by adding assembly filenames and/or assembly paths, and then load the assemblies you originally wanted to load.


Follow

Get every new post delivered to your Inbox.