Home

Problem running stand-alone script after running it with parameters.

To illustrate this issue, create a script

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

and save it as ShowParameters in your default queries folder.

If you run this query, it shows that args is null.

Then create a new query as follows

Util.OpenQuery(Path.Combine(Util.MyQueriesFolder , "ShowParameters.linq"), true, false, new string[] { "x" , "y"}).Dump();

When you run this query, it should run the first query and dump out the parameters "x" and "y"

All good so far.

But then if you re-run ShowParameters by itself , it still shows the parameters "x" and "y" when it should show null and it still does this even after the script has been amended and recompiled.

I have to close and restart Linqpad to get rid of the parameters.

A secondary very minor issue is - if I try to use the option "Reflect Query in ILSpy' it displays the error

Cannot find 'M:UserQuery.Main' in command line specified assemblies.

Comments

Sign In or Register to comment.