gluck / il-repack

Open-source alternative to ILMerge
Apache License 2.0
1.16k stars 214 forks source link

System.NullReferenceException on repacker.Repack(); #338

Closed Litmann closed 8 months ago

Litmann commented 8 months ago
public static void MergeAssemblies(string exePath, string dllPath)
{

    var repackOptions = new RepackOptions
    {
        InputAssemblies = new[] { exePath, dllPath },
        OutputFile = mergedExePath
    };

    var repacker = new ILRepack(repackOptions);
    repacker.Repack();
    MessageBox.Show($"Merged EXE created at {mergedExePath}");
}

All paths are correct, permissons on folder also. But on "repacker.Repack()" i got a NullReferenceException. In Debug mode all inputs are correct and the output is also correct. Anyone the same problem or is there a option missing?

KirillOsenkov commented 8 months ago

What exact version are you using? can you paste the full call stack of the exception?

in Visual Studio Tools -> Options -> Debugging -> General, disable Just My Code, and then in Debugging -> Windows -> Exception Settings check all .NET/CLR exceptions and then debug.

To debug ILRepack.exe you can open ILRepack.exe as a project in Visual Studio and press F5.

KirillOsenkov commented 8 months ago

This should be fixed in https://github.com/gluck/il-repack/commit/68de90a7256c217ff90ac11646459c51086359e9