Run lprun.exe with Command line parameters

We're trying to execute lprun.exe from batch file like
E:\LINQPad\lprun.exe "E:\cart\build\scripts\Main.linq" ParamaterOne
When running it always generate below error.
Input string was not in a correct format.
at System.Text.StringBuilder.FormatError()
at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.Format(String format, Object arg0)
at UserQuery.Main(String[] args)
Could you please help?


  • I tried with a super simple example of

    void Main(string[] args) { args.Dump(); }

    and am able to execute it with LPRun (LINQPad v5.25) with no problems.

    It sounds like you have some code in your UserQuery that is throwing this error. Specifically, it looks like you are using a format string that .NET doesn't like.
    I can replicate your problem using string.Format("{}", args).Dump(); fixing it to use string.Format("{0}", args).Dump(); works.
  • Hi kingkeith,
    Thank you, will try again.
  • edited November 2017
    Thanx a lot this is very useful code to play with it
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!