Skip to content

Instantly share code, notes, and snippets.

@flq flq/nasties.cs
Last active Dec 16, 2017

Embed
What would you like to do?
Ye olde NRE from a ctor call
using System;
using System.Runtime.Remoting.Proxies;
internal class Program
{
private static void Main(string[] args)
{
var c = new CrazyObject();
Console.WriteLine(c.Hello());
Console.ReadLine();
}
}
[Silly]
public class CrazyObject : ContextBoundObject
{
public string Hello() => "Hello Back";
}
public class SillyAttribute : ProxyAttribute
{
public override MarshalByRefObject CreateInstance(Type serverType) => null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.