microsoft/semantic-kernel · error · KernelException

Type '{stepInfo.InnerStepDotnetType}' is not a valid KernelP

Error message

Type '{stepInfo.InnerStepDotnetType}' is not a valid KernelProcessStep type.

What it means

After successfully loading the inner step type via Type.GetType, InitializeStep validates that it inherits from KernelProcessStep. If it does not, this KernelException is thrown. The Dapr runtime can only execute steps that derive from the Semantic Kernel process step base class.

Source

Thrown at dotnet/src/Experimental/Process.Runtime.Dapr/Actors/StepActor.cs:107

    /// Initializes the step with the provided step information.
    /// </summary>
    /// <param name="stepInfo">The <see cref="KernelProcessStepInfo"/> instance describing the step.</param>
    /// <param name="parentProcessId">The Id of the parent process if one exists.</param>
    /// <param name="eventProxyStepId">An optional identifier of an actor requesting to proxy events.</param>
    private void InitializeStep(DaprStepInfo stepInfo, string? parentProcessId, string? eventProxyStepId = null)
    {
        Verify.NotNull(stepInfo, nameof(stepInfo));

        // Attempt to load the inner step type
        this._innerStepType = Type.GetType(stepInfo.InnerStepDotnetType);
        if (this._innerStepType is null)
        {
            throw new KernelException($"Could not load the inner step type '{stepInfo.InnerStepDotnetType}'.").Log(this._logger);
        }

        if (!typeof(KernelProcessStep).IsAssignableFrom(this._innerStepType))
        {
            throw new KernelException($"Type '{stepInfo.InnerStepDotnetType}' is not a valid KernelProcessStep type.").Log(this._logger);
        }

        this.ParentProcessId = parentProcessId;
        this._stepInfo = stepInfo;
        this._stepState = this._stepInfo.State;
        this._logger = this._kernel.LoggerFactory?.CreateLogger(this._innerStepType) ?? new NullLogger<StepActor>();
        this._outputEdges = this._stepInfo.Edges.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToList());
        this._eventNamespace = $"{this._stepInfo.State.Name}_{this._stepInfo.State.Id}";

        if (!string.IsNullOrWhiteSpace(eventProxyStepId))
        {
            this.EventProxyStepId = new ActorId(eventProxyStepId);
        }

        this._isInitialized = true;
    }

    /// <summary>

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Ensure the type referenced by InnerStepDotnetType inherits from KernelProcessStep or KernelProcessStep<TState>.
  2. If the step class was refactored, restore the KernelProcessStep inheritance or rebuild and re-serialize the process graph.
  3. Audit the process builder code to confirm that only KernelProcessStep-derived types are registered as steps.

Example fix

// before — step class missing base
public class MyStep { ... }

// after
public class MyStep : KernelProcessStep { ... }
Defensive patterns

Strategy: validation

Validate before calling

Type? stepType = Type.GetType(stepInfo.InnerStepDotnetType);
if (stepType is null || !typeof(KernelProcessStep).IsAssignableFrom(stepType))
{
    throw new InvalidOperationException($"Type '{stepInfo.InnerStepDotnetType}' must inherit from KernelProcessStep.");
}

Type guard

static bool IsValidStepType(string assemblyQualifiedName)
{
    var t = Type.GetType(assemblyQualifiedName);
    return t is not null && typeof(KernelProcessStep).IsAssignableFrom(t);
}

Try / catch

try
{
    await stepActor.InitializeStepAsync(stepInfo, parentProcessId);
}
catch (KernelException ex) when (ex.Message.Contains("not a valid KernelProcessStep type"))
{
    logger.LogError("Type '{Type}' does not inherit from KernelProcessStep.", stepInfo.InnerStepDotnetType);
}

Prevention

When it happens

Trigger: InnerStepDotnetType resolves to a valid CLR type, but that type is not a subclass of KernelProcessStep. This happens when a non-step type name was accidentally stored in InnerStepDotnetType, or the step class was refactored to no longer inherit from KernelProcessStep.

Common situations: A process graph was serialized with a type name that does not derive from KernelProcessStep (e.g. a plain POCO or a data model class). A step class had its base class removed during refactoring. A custom DaprStepInfo was constructed with an incorrect InnerStepDotnetType value.

Related errors


AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13). Data as JSON: /api/errors/6d7697f98c22cfbb. Report an issue: GitHub.