microsoft/semantic-kernel · critical · NotSupportedException

Vector store type '{appConfig.RagConfig.VectorStoreType}' is

Error message

Vector store type '{appConfig.RagConfig.VectorStoreType}' is not supported.

What it means

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.

Source

Thrown at dotnet/samples/Demos/VectorStoreRAG/Program.cs:116

            appConfig.QdrantConfig.Host,
            appConfig.QdrantConfig.Port,
            appConfig.QdrantConfig.Https,
            appConfig.QdrantConfig.ApiKey);
        break;
    case "Redis":
        kernelBuilder.Services.AddRedisJsonCollection<TextSnippet<string>>(
            appConfig.RagConfig.CollectionName,
            appConfig.RedisConfig.ConnectionConfiguration);
        break;
    case "Weaviate":
        kernelBuilder.Services.AddWeaviateCollection<TextSnippet<Guid>>(
            // Weaviate collection names must start with an upper case letter.
            char.ToUpper(appConfig.RagConfig.CollectionName[0], CultureInfo.InvariantCulture) + appConfig.RagConfig.CollectionName.Substring(1),
            endpoint: new Uri(appConfig.WeaviateConfig.Endpoint),
            apiKey: null);
        break;
    default:
        throw new NotSupportedException($"Vector store type '{appConfig.RagConfig.VectorStoreType}' is not supported.");
}

// Register all the other required services.
switch (appConfig.RagConfig.VectorStoreType)
{
    case "AzureAISearch":
    case "CosmosMongoDB":
    case "CosmosNoSql":
    case "InMemory":
    case "Redis":
        RegisterServices<string>(builder, kernelBuilder, appConfig);
        break;
    case "Qdrant":
    case "Weaviate":
        RegisterServices<Guid>(builder, kernelBuilder, appConfig);
        break;
    default:
        throw new NotSupportedException($"Vector store type '{appConfig.RagConfig.VectorStoreType}' is not supported.");

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Set RagConfig:VectorStoreType to one of: 'AzureAISearch', 'CosmosMongoDB', 'CosmosNoSql', 'InMemory', 'Redis', 'Qdrant', 'Weaviate'.
  2. Add a new case arm if you need an additional vector store type.
  3. Double-check for trailing spaces, casing, or hidden characters in the configured value.
  4. Log the raw configured value at startup before the switch to catch silent mismatches.

Example fix

// before
default:
    throw new NotSupportedException($"Vector store type '{appConfig.RagConfig.VectorStoreType}' is not supported.");

// after — enumerate valid values in the message
default:
    throw new NotSupportedException(
        $"Vector store type '{appConfig.RagConfig.VectorStoreType}' is not supported. " +
        "Valid values: AzureAISearch, CosmosMongoDB, CosmosNoSql, InMemory, Redis, Qdrant, Weaviate.");
Defensive patterns

Strategy: validation

Validate before calling

var validStores = new[] { "AzureAISearch", "CosmosMongoDB", "CosmosNoSql", "InMemory", "Redis", "Qdrant", "Weaviate" };
if (!validStores.Contains(appConfig.RagConfig.VectorStoreType))
    throw new ArgumentException($"VectorStoreType must be one of: {string.Join(", ", validStores)}. Got: '{appConfig.RagConfig.VectorStoreType}'");

Type guard

bool IsValidVectorStore(string? s) => s is "AzureAISearch" or "CosmosMongoDB" or "CosmosNoSql" or "InMemory" or "Redis" or "Qdrant" or "Weaviate";

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


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