muonlab » Mono

random .NET and web development musings

Pretty self explanatory when you know how:

Updated this code to use Mono.Cecil 0.9.5.0

var assembly = AssemblyDefinition.ReadAssembly(@"path\to\assembly");

var someType = assembly.MainModule.Types.FirstOrDefault(v => v.Name == "SomeTypeName");

someType.Namespace = "I.Live.Somewhere.New";
someType.Name = "NewName";

assembly.Write(@"path\to\output");