.net-reflector

Dotpeek recompile decompiled files

半城伤御伤魂 提交于 2019-12-01 08:18:44
How i can recompile my edited codes Or replace it with original files and save it as exe in dotpeek ? I try to recompile edited files and save it but i cant If you found any way please share Thanks Right click the opened file in Assembly Explorer pane and choose, Export to Project, this will save it as a Visual Studio Project that you can open and work towards compiling. 来源: https://stackoverflow.com/questions/27365003/dotpeek-recompile-decompiled-files

Viewing the IL code generated from a compiled expression

╄→尐↘猪︶ㄣ 提交于 2019-11-27 06:41:20
Is it possible to view the IL code generated when you call Compile() on an Expression tree? Consider this very simple example: class Program { public int Value { get; set; } static void Main(string[] args) { var param = Expression.Parameter(typeof(Program)); var con = Expression.Constant(5); var prop = Expression.Property(param, typeof(Program).GetProperty("Value")); var assign = Expression.Assign(prop, con); Action<Program> lambda = Expression.Lambda<Action<Program>>(assign, param).Compile(); Program p = new Program(); lambda(p); //p.Value = 5; } } Now, the expression tree does what the last

Is there a way to “override” a method with reflection?

我们两清 提交于 2019-11-27 04:48:08
Without inherit but only with reflection is it possible to dynamically change the code of a method in C#? something like : nameSpaceA.Foo.method1 = aDelegate; I cannot change/edit The Foo Class. namespace nameSpaceA { class Foo { private void method1() { // ... some Code } } } My final objective is to change dynamicaly the code of : public static IList<XPathNavigator> EnsureNodeSet(IList<XPathItem> listItems); In System.Xml.Xsl.Runtime.XslConvert.cs to turn : if (!item.IsNode) throw new XslTransformException(Res.XPath_NodeSetExpected, string.Empty); into : if (!item.IsNode) throw new

Viewing the IL code generated from a compiled expression

北城以北 提交于 2019-11-26 12:07:07
问题 Is it possible to view the IL code generated when you call Compile() on an Expression tree? Consider this very simple example: class Program { public int Value { get; set; } static void Main(string[] args) { var param = Expression.Parameter(typeof(Program)); var con = Expression.Constant(5); var prop = Expression.Property(param, typeof(Program).GetProperty(\"Value\")); var assign = Expression.Assign(prop, con); Action<Program> lambda = Expression.Lambda<Action<Program>>(assign, param).Compile

Is there a way to “override” a method with reflection?

梦想的初衷 提交于 2019-11-26 11:21:24
问题 Without inherit but only with reflection is it possible to dynamically change the code of a method in C#? something like : nameSpaceA.Foo.method1 = aDelegate; I cannot change/edit The Foo Class. namespace nameSpaceA { class Foo { private void method1() { // ... some Code } } } My final objective is to change dynamicaly the code of : public static IList<XPathNavigator> EnsureNodeSet(IList<XPathItem> listItems); In System.Xml.Xsl.Runtime.XslConvert.cs to turn : if (!item.IsNode) throw new