我从CIL到C#转换器(.Net反射器)恢复了以下类。不幸的是,VS2010不会编译它。任何想法如何让它工作?为什么这个反汇编代码不能在C#中编译?
using System;
using System.IO;
using System.Reflection;
internal class <Module>
{
static <Module>()
{
IPLRes.ExeDirectory = new FileInfo(Assembly.GetExecutingAssembly>>().Location).DirectoryName;
AppDomain expr_1E = AppDomain.CurrentDomain;
expr_1E.AssemblyResolve += new ResolveEventHandler(expr_1E.AssemblyNotFound);
IPLRes.LogDirectory = IPLRes.ExeDirectory + "\\log";
IPLMsg.Log("Loader", "Application starting...");
}
public static Assembly AssemblyNotFound(object A_0, ResolveEventArgs A_1)
{
string text = A_1.Name;
text = text.Remove(text.IndexOf(","));
text = IPLRes.ExeDirectory + "\\bin35\\" + text + ".dll";
return Assembly.LoadFile(text);
}
[STAThread]
public static void IPLMain(string[] A_0)
{
if (A_0.Length >= 1)
{
IPLRes.BatchMode = A_0[0].Contains("batch");
}
if (!IPLRes.BatchMode)
{
IPLRes.ShowSplash("ipl_splash.png");
}
string[] array = new string[]
{
"-X:FullFrames",
"-X:Python30",
"-c",
IPLRes.GetString("ipl_entrypoint35.py")
};
IPLMsg.Log("Loader", "Starting main interpreter");
IPLRes.MainInterpreter = new IronPythonHost();
if (IPLRes.MainInterpreter.Run(array) != 0)
{
array = new string[]
{
"-c",
IPLRes.GetString("ipl_crash.py")
};
IPLMsg.Log("Loader", "Starting crash handler interpreter");
IPLRes.CrashInterpreter = new IronPythonHost();
IPLRes.CrashInterpreter.Run(array);
}
IPLMsg.Log("Loader", "Application shutting down.");
IPLMsg.DumpLogFile();
}
}
我不明白这个问题。什么是“*但VS2010不能接受任何想法?”应该是什么意思? –
这意味着编译器在尝试编译非法命名的类“”时会变得很迟钝。看看SLaks的回答,看看这里到底发生了什么。 –
dlev
考虑添加特定的编译器错误消息 - 即使没有它可以看到问题(s),它会添加背景和参考。 – 2011-08-22 20:36:03