Home

Lprun redirected to output doesn't show everything when exception

Here is my (simplified) 'Publish Sites - Server.linq' script I run with lprun.exe
void Main( string[] args )
{
	try
	{	        
		File.Copy( @"\\192.168.112.129\Publishing\Deployments\RemotePackageConfiguration.xml", "\\192.168.112.187\d$\websites\RemotePackageConfiguration.xml", true );
		
	}
	catch (Exception ex)
	{
		( "Error Running Script: " + ex.Message + "\r\n\r\n" + ex.StackTrace ).Dump();
	}
}
I have the following 'publish.bat' batch file that I create:
"C:\Program Files (x86)\LINQPad4\lprun.exe" -format=html "\\192.168.112.129\Publishing\Deployments\Publish Sites - Server.linq" "\\192.168.112.129\Publishing\Deployments\Instructions\2016-03-01T120825.xml" > "%1"
I then execute this via publish.bat "\\192.168.112.129\Publishing\Deployments\Instructions\2016-03-01T120825.xml.html".

However, when the linq script doesn't have access to 187 and throws an error, I get an empty HTML file. Is that expected?

Comments

  • Hmm, that script above was bad sample as I need a @"" so it compiles. Then this script shows exception in the HTML appropriately. I wanted to simplify my script because my main script that does compile/run seems to output 0 byte files occasionally when there is an exception and I can pin point the problem. Will keep looking to create a better example.
Sign In or Register to comment.