src/Interactive/Host/Interactive/Core/InteractiveHost.cs
/// <summary>
/// Restarts and reinitializes the host process (or starts a new one if it is not running yet).
/// </summary>
/// <param name="options">The options to initialize the new process with.</param>
Restarts and reinitializes the host process (or starts a new one if it is not running yet).
Restarts and reinitializes the host process ( or starts a new one if it is not running yet ) .
public async Task<RemoteExecutionResult> ResetAsync(InteractiveHostOptions options)
        {
            try
            {
                var newService = CreateRemoteService(options, skipInitialization: false);
                var oldService = Interlocked.Exchange(ref _lazyRemoteService, newService);
                if (oldService != null)
                {
                    oldService.Dispose();
                }
                var initializedService = await TryGetOrCreateRemoteServiceAsync().ConfigureAwait(false);
                if (initializedService.Service == null)
                {
                    return default;
                }
                return initializedService.InitializationResult;
            }
            catch (Exception e) when (FatalError.Report(e))
            {
                throw ExceptionUtilities.Unreachable;
            }
        }
public async Task < RemoteExecutionResult > ResetAsync ( InteractiveHostOptions options ) { try { var newService = CreateRemoteService ( options , skipInitialization : false ) ; var oldService = Interlocked . Exchange ( ref _lazyRemoteService , newService ) ; if ( oldService != null ) { oldService . Dispose ( ) ; } var initializedService = await TryGetOrCreateRemoteServiceAsync ( ) . ConfigureAwait ( false ) ; if ( initializedService . Service == null ) { return default ; } return initializedService . InitializationResult ; } catch ( Exception e ) when ( FatalError . Report ( e ) ) { throw ExceptionUtilities . Unreachable ; } }
Restarts and reinitializes the host process (or starts a new one if it is not running yet).
Restarts and reinitializes the host process ( or starts a new one if it is not running yet ) .
// replace the existing service with a new one:
options
InteractiveHostOptions
The options to initialize the new process with.
The options to initialize the new process with .