ILMerge generated assembly doesn't run, although log output reports no errors - why is this?

前端 未结 5 1071
一向
一向 2021-02-03 11:41

I\'m testing out ILMerge for a new project, and although the .exe file seems to be created correctly, it won\'t run.

I have installed ILMerge via the .msi installer (fou

5条回答
  •  面向向阳花
    2021-02-03 12:31

    Check your event viewer for any detailed error messages.

    Wrap the body of your void Main(string args[]) method with

    try
    {
    ...
    }
    catch (Exception ex)
    {
      Console.WriteLine(ex.ToString());
    }
    

    Also try changing your platform target to x86 for example.

    You shouldn't need to specify the .net framework directories on the /lib and /targetplatform command line switches if you specify /targetplatform:v4.

提交回复
热议问题