Azure-docs: The name 'ExitProgram' does not exist in the current context

Created on 6 Mar 2020  Â·  3Comments  Â·  Source: MicrosoftDocs/azure-docs

The name 'ExitProgram' does not exist in the current context
image


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 assigned-to-author cognitive-searcsvc doc-bug triaged

Most helpful comment

This is the function that needs to be added to your program in Main(). I'll add this to the doc today.

private static void ExitProgram(string message)
{
Console.WriteLine("{0}", message);
Console.WriteLine("Press any key to exit the program...");
Console.ReadKey();
Environment.Exit(0);
}

All 3 comments

@v-tawe, Thanks for leveraging Azure docs feedback channel to raise this question!
This channel is reserved for ‘Azure docs’ feedback- document feedback & content improvements. While I check on this further, kindly do share more information on the document step (process) you're facing issues with to better assist you.

This is the function that needs to be added to your program in Main(). I'll add this to the doc today.

private static void ExitProgram(string message)
{
Console.WriteLine("{0}", message);
Console.WriteLine("Press any key to exit the program...");
Console.ReadKey();
Environment.Exit(0);
}

Thank you @MarkHeff for the comments and swift fix!

@v-tawe, the document now has a section "Add function to exit the program during failure" with the function Mark highlighted above.
I have added a screenshot here for your quick reference:

image

Thanks again for bringing this issue to our attention. We will now proceed to close this thread. If there are further questions regarding this matter, please tag us in your reply. We will gladly continue the discussion.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

monteledwards picture monteledwards  Â·  3Comments

AronT-TLV picture AronT-TLV  Â·  3Comments

Agazoth picture Agazoth  Â·  3Comments

jamesgallagher-ie picture jamesgallagher-ie  Â·  3Comments

behnam89 picture behnam89  Â·  3Comments