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");
2 COMMENTS
Jb Evain
August 2, 2011
ad

Hi, I suggest you use the more modern 0.9 version of Cecil from:

http://github.com/jbevain/cecil

Or available in nuget. It requires some changes outlined there:

http://github.com/jbevain/cecil/wiki/Migration

But speed and API wise, it’s totally worth it :)

August 2, 2011
ad

Interesting, I’ve updated the post. Thanks!

Post a comment