{"record":{"id":"30e2eb8e6b5da490","repo":"microsoft/semantic-kernel","slug":"vector-store-type-appconfig-ragconfig-vectorstor","errorCode":null,"errorMessage":"Vector store type '{appConfig.RagConfig.VectorStoreType}' is not supported.","messagePattern":"Vector store type '(.+?)' is not supported\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"critical","filePath":"dotnet/samples/Demos/VectorStoreRAG/Program.cs","lineNumber":116,"sourceCode":"            appConfig.QdrantConfig.Host,\n            appConfig.QdrantConfig.Port,\n            appConfig.QdrantConfig.Https,\n            appConfig.QdrantConfig.ApiKey);\n        break;\n    case \"Redis\":\n        kernelBuilder.Services.AddRedisJsonCollection<TextSnippet<string>>(\n            appConfig.RagConfig.CollectionName,\n            appConfig.RedisConfig.ConnectionConfiguration);\n        break;\n    case \"Weaviate\":\n        kernelBuilder.Services.AddWeaviateCollection<TextSnippet<Guid>>(\n            // Weaviate collection names must start with an upper case letter.\n            char.ToUpper(appConfig.RagConfig.CollectionName[0], CultureInfo.InvariantCulture) + appConfig.RagConfig.CollectionName.Substring(1),\n            endpoint: new Uri(appConfig.WeaviateConfig.Endpoint),\n            apiKey: null);\n        break;\n    default:\n        throw new NotSupportedException($\"Vector store type '{appConfig.RagConfig.VectorStoreType}' is not supported.\");\n}\n\n// Register all the other required services.\nswitch (appConfig.RagConfig.VectorStoreType)\n{\n    case \"AzureAISearch\":\n    case \"CosmosMongoDB\":\n    case \"CosmosNoSql\":\n    case \"InMemory\":\n    case \"Redis\":\n        RegisterServices<string>(builder, kernelBuilder, appConfig);\n        break;\n    case \"Qdrant\":\n    case \"Weaviate\":\n        RegisterServices<Guid>(builder, kernelBuilder, appConfig);\n        break;\n    default:\n        throw new NotSupportedException($\"Vector store type '{appConfig.RagConfig.VectorStoreType}' is not supported.\");","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/samples/Demos/VectorStoreRAG/Program.cs#L98-L134","documentation":"VectorStoreRAG's first vector-store switch (around line 116) registers the record collection for the configured RagConfig.VectorStoreType. Supported values include AzureAISearch, CosmosMongoDB, CosmosNoSql, InMemory, Redis, Qdrant, and Weaviate. Any other value hits the default branch and throws NotSupportedException.","triggerScenarios":"The RagConfig.VectorStoreType configuration value doesn't match any of the seven supported store type strings — e.g., 'Elasticsearch', 'Pinecone', 'Postgres', null, or a typo like 'Redis ' (trailing space).","commonSituations":"Typo or casing error in configuration; the value is unset (null); using a vector store that this sample hasn't been extended to support; copying configuration from a different sample that uses different store names.","solutions":["Set RagConfig:VectorStoreType to one of: 'AzureAISearch', 'CosmosMongoDB', 'CosmosNoSql', 'InMemory', 'Redis', 'Qdrant', 'Weaviate'.","Add a new case arm if you need an additional vector store type.","Double-check for trailing spaces, casing, or hidden characters in the configured value.","Log the raw configured value at startup before the switch to catch silent mismatches."],"exampleFix":"// before\ndefault:\n    throw new NotSupportedException($\"Vector store type '{appConfig.RagConfig.VectorStoreType}' is not supported.\");\n\n// after — enumerate valid values in the message\ndefault:\n    throw new NotSupportedException(\n        $\"Vector store type '{appConfig.RagConfig.VectorStoreType}' is not supported. \" +\n        \"Valid values: AzureAISearch, CosmosMongoDB, CosmosNoSql, InMemory, Redis, Qdrant, Weaviate.\");","handlingStrategy":"validation","validationCode":"var validStores = new[] { \"AzureAISearch\", \"CosmosMongoDB\", \"CosmosNoSql\", \"InMemory\", \"Redis\", \"Qdrant\", \"Weaviate\" };\nif (!validStores.Contains(appConfig.RagConfig.VectorStoreType))\n    throw new ArgumentException($\"VectorStoreType must be one of: {string.Join(\", \", validStores)}. Got: '{appConfig.RagConfig.VectorStoreType}'\");","typeGuard":"bool IsValidVectorStore(string? s) => s is \"AzureAISearch\" or \"CosmosMongoDB\" or \"CosmosNoSql\" or \"InMemory\" or \"Redis\" or \"Qdrant\" or \"Weaviate\";","tryCatchPattern":null,"preventionTips":["Centralize valid store-type constants and validate against them at startup.","Log the raw configured value before the switch.","Consider a configuration validation step using IValidateOptions<T>."],"tags":["configuration","not-supported","rag","vector-store","startup"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}