Note that there are some explanatory texts on larger screens.

plurals
  1. POReturn Custom Silverlight OOB Application ExitCode
    primarykey
    data
    text
    <p>I would like to customize the exit code of my elevated trust, Out of Browser (OOB) Silverlight 4 application. I'm currently attempting to use the <a href="http://msdn.microsoft.com/en-us/library/system.environment.exitcode%28v=vs.95%29.aspx" rel="nofollow noreferrer">System.Environment.ExitCode</a> property to customize the exit value of my SL4 app, however, it appears that it is being overriden by sllauncher.exe and always returns 0. </p> <p>Here are the only changes made to a default SilverlightApplication generated by Visual Studio, outside of adjustments to the project properties to enable OOB Elevated Trust:</p> <p>At MainPage.xaml.cs:</p> <pre><code>public MainPage() { InitializeComponent(); Environment.ExitCode = 42; } </code></pre> <p>Also updated App.xaml.cs as a precaution:</p> <pre><code>private void Application_Exit(object sender, EventArgs e) { Environment.ExitCode = 42; } </code></pre> <p>Once the XAP is installed to the local system, I'm using the <a href="https://stackoverflow.com/questions/334879/how-do-i-get-the-application-exit-code-from-a-windows-command-line/11476681#11476681">"start /wait" syntax</a> via command prompt to launch the OOB app and ensure that the exit code of the Windowed application is set, ie:</p> <pre><code>start /wait sllauncher.exe 1899735003.localhost </code></pre> <p>After closing the app, thereby returning focus to the command prompt, and running:</p> <pre><code>echo Exit Code is %errorlevel% </code></pre> <p>The Exit Code is always set to 0.</p> <p>Is there a way to have sllauncher set an exit code provided by the OOB app?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload