{"record":{"id":"a539e865f3a4108a","repo":"microsoft/semantic-kernel","slug":"could-not-load-type-assemblyqualifiedtypename","errorCode":null,"errorMessage":"Could not load type '{assemblyQualifiedTypeName}'.","messagePattern":"Could not load type '(.+?)'\\.","errorType":"exception","errorClass":"KernelException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Experimental/Process.Runtime.Dapr/Serialization/TypeInfo.cs","lineNumber":44,"sourceCode":"    /// Restore the object's type from the provided assembly qualified type-name, but\n    /// only if it is a <see cref=\"JsonElement\"/>. Otherwise, return the original value.\n    /// </summary>\n    public static object? ConvertValue(string? assemblyQualifiedTypeName, object? value)\n    {\n        if (value == null || value.GetType() != typeof(JsonElement))\n        {\n            return value;\n        }\n\n        if (assemblyQualifiedTypeName == null)\n        {\n            throw new KernelException(\"Data persisted without type information.\");\n        }\n\n        Type? valueType = Type.GetType(assemblyQualifiedTypeName);\n        if (valueType is null)\n        {\n            throw new KernelException($\"Could not load type '{assemblyQualifiedTypeName}'.\");\n        }\n\n        return ((JsonElement)value).Deserialize(valueType);\n    }\n}\n","sourceCodeStart":26,"sourceCodeEnd":50,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Experimental/Process.Runtime.Dapr/Serialization/TypeInfo.cs#L26-L50","documentation":"Thrown by TypeInfo.ConvertValue when Type.GetType cannot resolve the provided assembly-qualified type name to a .NET Type. The JsonElement value cannot be deserialized without knowing its target type.","triggerScenarios":"ConvertValue resolves Type.GetType(assemblyQualifiedTypeName); a null result means the type (or its assembly) is not available to the current runtime.","commonSituations":"The type's assembly is not loaded by the actor host, the assembly-qualified name is malformed or truncated, the type was renamed/removed in a newer version, or trimming removed the type metadata.","solutions":["Deploy the assembly containing the persisted value's type to the Dapr actor host.","Verify the assembly-qualified name is complete and correct (assembly, version, PublicKeyToken).","If the type moved, add TypeForwardedFrom or load the appropriate AssemblyLoadContext.","Disable aggressive trimming/AOT for assemblies holding persisted value types."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var valueType = Type.GetType(assemblyQualifiedTypeName);\nif (valueType is null)\n    throw new InvalidOperationException($\"Type '{assemblyQualifiedTypeName}' is not loadable; deploy its assembly.\");","typeGuard":"public static bool IsTypeLoadable(string assemblyQualifiedTypeName) =>\n    Type.GetType(assemblyQualifiedTypeName) is not null;","tryCatchPattern":"try\n{\n    var restored = TypeInfo.ConvertValue(typeName, value);\n}\ncatch (KernelException ex) when (ex.Message.Contains(\"Could not load type\"))\n{\n    _logger.LogError(ex, \"Persisted value type assembly is missing from the host.\");\n    throw;\n}","preventionTips":["Deploy assemblies for all persisted value types to the actor host.","Store complete assembly-qualified type names.","Avoid renaming/moving persisted types; use TypeForwardedFrom when refactoring."],"tags":["dapr","process-runtime","type-resolution","assembly-loading","json"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}