ClickOnce and AppContext parameter [Switch.System.Threading.ThrowExceptionIfDisposedCancellationTokenSource] RRS feed

  • Question

  • Hello.

    I launch the application on ClickOnce (with .appref-ms) and see the value of parameter [Switch.System.Threading.ThrowExceptionIfDisposedCancellationTokenSource] equals true (with System.AppContext). However, this parameter was not set in the code. If I run the application directly (through .exe), the parameter is not set. I can explicitly set it in App.config and launch through ClickOnce. This will work (parameter set false).

    It is important for me to understand how and where the parameter is set when starting through ClickOnce shell.


    • Edited by Elman Aliev Thursday, November 7, 2019 9:47 AM
    Thursday, November 7, 2019 9:46 AM

All replies

  • Hi Elman Aliev,

    About how to set the parameter through the "ClickOnce shell", here is a blog you can refer to.

    [RobinDotNet's Blog]

    Best Regards,
    Daniel Zhang

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Friday, November 8, 2019 2:30 AM