diff --git a/Plugins/API/DllExporter/DllExporter.csproj b/Plugins/API/DllExporter/DllExporter.csproj index b0628af5..4cf20b5c 100644 --- a/Plugins/API/DllExporter/DllExporter.csproj +++ b/Plugins/API/DllExporter/DllExporter.csproj @@ -1,5 +1,5 @@  - + Debug x86 @@ -10,7 +10,7 @@ Properties DllExporter DllExporter - v2.0 + v4.0 512 publish\ true @@ -71,7 +71,7 @@ 1607 - + diff --git a/Plugins/API/DllExporter/Program.cs b/Plugins/API/DllExporter/Program.cs index e5d97deb..5b6954d1 100644 --- a/Plugins/API/DllExporter/Program.cs +++ b/Plugins/API/DllExporter/Program.cs @@ -36,8 +36,11 @@ namespace DllExporter string targetIlName = targetDllName + ".il"; string targetResName = targetDllName + ".res"; - string ilasmPath = ToolLocationHelper.GetPathToDotNetFrameworkFile("ilasm.exe", TargetDotNetFrameworkVersion.Version20); - if (!File.Exists(ilasmPath)) + bool is64 = platformTarget.ToLower().Equals("x64"); + bool isDebug = configurationName.ToLower().Equals("debug"); + + string ilasmPath = FindIlasmPath(is64); + if (ilasmPath == null) { Console.WriteLine("DllExporter error: ilasm.exe not found"); return 1; @@ -52,9 +55,6 @@ namespace DllExporter Directory.SetCurrentDirectory(targetDirectory); - bool is64 = platformTarget.ToLower().Equals("x64"); - bool isDebug = configurationName.ToLower().Equals("debug"); - // Disassemble Process ildasmProc = new Process(); string ildasmArgs = string.Format( @@ -171,6 +171,17 @@ namespace DllExporter return 0; } + /// + /// Finds path to ilasm.exe. + /// + private static string FindIlasmPath(bool x64) + { + var arch = x64 ? DotNetFrameworkArchitecture.Bitness64 : DotNetFrameworkArchitecture.Bitness32; + var path = ToolLocationHelper.GetPathToDotNetFrameworkFile( + "ilasm.exe", TargetDotNetFrameworkVersion.Version20, arch); + return File.Exists(path) ? path : null; + } + /// /// Finds path to ildasm.exe. ///