{"record":{"id":"1df608c62feb5ab0","repo":"microsoft/semantic-kernel","slug":"type-this-innerstepdotnettype-is-not-a-valid-k","errorCode":null,"errorMessage":"Type '{this.InnerStepDotnetType}' is not a valid KernelProcessStep type.","messagePattern":"Type '(.+?)' is not a valid KernelProcessStep type\\.","errorType":"exception","errorClass":"KernelException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Experimental/Process.Runtime.Dapr/DaprStepInfo.cs","lineNumber":55,"sourceCode":"    /// </summary>\n    public required Dictionary<string, List<KernelProcessEdge>> Edges { get; init; }\n\n    /// <summary>\n    /// Builds an instance of <see cref=\"KernelProcessStepInfo\"/> from the current object.\n    /// </summary>\n    /// <returns>An instance of <see cref=\"KernelProcessStepInfo\"/></returns>\n    /// <exception cref=\"KernelException\"></exception>\n    public KernelProcessStepInfo ToKernelProcessStepInfo()\n    {\n        Type? innerStepType = Type.GetType(this.InnerStepDotnetType);\n        if (innerStepType is null)\n        {\n            throw new KernelException($\"Unable to create inner step type from assembly qualified name `{this.InnerStepDotnetType}`\");\n        }\n\n        if (!typeof(KernelProcessStep).IsAssignableFrom(innerStepType))\n        {\n            throw new KernelException($\"Type '{this.InnerStepDotnetType}' is not a valid KernelProcessStep type.\");\n        }\n\n        return new KernelProcessStepInfo(innerStepType, this.State, this.Edges);\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"DaprStepInfo\"/> class from an instance of <see cref=\"KernelProcessStepInfo\"/>.\n    /// </summary>\n    /// <returns>An instance of <see cref=\"DaprStepInfo\"/></returns>\n    public static DaprStepInfo FromKernelStepInfo(KernelProcessStepInfo kernelStepInfo)\n    {\n        Verify.NotNull(kernelStepInfo, nameof(kernelStepInfo));\n\n        return new DaprStepInfo\n        {\n            InnerStepDotnetType = kernelStepInfo.InnerStepType.AssemblyQualifiedName!,\n            State = kernelStepInfo.State,\n            Edges = kernelStepInfo.Edges.ToDictionary(kvp => kvp.Key, kvp => new List<KernelProcessEdge>(kvp.Value)),","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Experimental/Process.Runtime.Dapr/DaprStepInfo.cs#L37-L73","documentation":"Thrown when the resolved inner step type does not implement KernelProcessStep. After successfully loading the Type from its assembly-qualified name, the runtime verifies it is assignable to KernelProcessStep; a type that fails this check is not a valid process step.","triggerScenarios":"DaprStepInfo.ToKernelProcessStepInfo() checks `typeof(KernelProcessStep).IsAssignableFrom(innerStepType)` and throws when the type is some other class that happens to share the persisted type name or was mistakenly registered as a step.","commonSituations":"The persisted InnerStepDotnetType was changed to point at a non-step class, the assembly-qualified name collided with a different type after a refactor, or a generic/utility class was accidentally used as a step type.","solutions":["Confirm the persisted type actually implements KernelProcessStep (directly or via a step base class).","Correct the InnerStepDotnetType in the process definition to point at a real KernelProcessStep subclass.","If the type was refactored, update the process definition and re-persist it."],"exampleFix":"// before\npublic class MyWorker { } // not a step\n// after\npublic class MyWorker : KernelProcessStep\n{\n    [KernelProcessStepProcessFunction]\n    public ValueTask DoWorkAsync(ProcessMessage msg) => ValueTask.CompletedTask;\n}","handlingStrategy":"validation","validationCode":"var t = Type.GetType(step.InnerStepDotnetType);\nif (t is null || !typeof(KernelProcessStep).IsAssignableFrom(t))\n    throw new InvalidOperationException($\"Type '{step.InnerStepDotnetType}' is not a valid KernelProcessStep.\");","typeGuard":"public static bool IsValidStepType(string assemblyQualifiedTypeName)\n{\n    var t = Type.GetType(assemblyQualifiedTypeName);\n    return t is not null && typeof(KernelProcessStep).IsAssignableFrom(t);\n}","tryCatchPattern":"try\n{\n    var info = daprStepInfo.ToKernelProcessStepInfo();\n}\ncatch (KernelException ex) when (ex.Message.Contains(\"not a valid KernelProcessStep type\"))\n{\n    _logger.LogError(ex, \"Persisted type is not a KernelProcessStep; check definition.\");\n    throw;\n}","preventionTips":["Only register KernelProcessStep subclasses as step types.","Add a unit test asserting each step type implements KernelProcessStep.","Validate step types at process-definition build time."],"tags":["dapr","process-runtime","type-validation","step-contract"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}