{"record":{"id":"ef15a05bb06ab884","repo":"dotnetcore/CAP","slug":"you-must-be-config-storage-provider-for-cap-eg-services","errorCode":null,"errorMessage":"You must be config storage provider for CAP!\n===================================================================================\n========   eg: services.AddCap( options => { options.UseSqlServer(...) }); ========\n===================================================================================","messagePattern":"You must be config storage provider for CAP!\n===================================================================================\n========   eg: services\\.AddCap\\( options => (.+?)\\); ========\n===================================================================================","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/DotNetCore.CAP/Internal/IBootstrapper.Default.cs","lineNumber":146,"sourceCode":"    {\n        var marker = _serviceProvider.GetService<CapMarkerService>();\n        if (marker == null)\n            throw new InvalidOperationException(\n                \"AddCap() must be added on the service collection.   eg: services.AddCap(...)\");\n\n        var messageQueueMarker = _serviceProvider.GetService<CapMessageQueueMakerService>();\n        if (messageQueueMarker == null)\n            throw new InvalidOperationException(\n                \"You must be config transport provider for CAP!\" + Environment.NewLine +\n                \"==================================================================================\" +\n                Environment.NewLine +\n                \"========   eg: services.AddCap( options => { options.UseRabbitMQ(...) }); ========\" +\n                Environment.NewLine +\n                \"==================================================================================\");\n\n        var databaseMarker = _serviceProvider.GetService<CapStorageMarkerService>();\n        if (databaseMarker == null)\n            throw new InvalidOperationException(\n                \"You must be config storage provider for CAP!\" + Environment.NewLine +\n                \"===================================================================================\" +\n                Environment.NewLine +\n                \"========   eg: services.AddCap( options => { options.UseSqlServer(...) }); ========\" +\n                Environment.NewLine +\n                \"===================================================================================\");\n    }\n\n    public ValueTask DisposeAsync()\n    {\n        Dispose();\n\n        return ValueTask.CompletedTask;\n    }\n}","sourceCodeStart":128,"sourceCodeEnd":161,"githubUrl":"https://github.com/dotnetcore/CAP/blob/e52b8508e54cdb7a9ce7f9fec03d9ea8ad2710fb/src/DotNetCore.CAP/Internal/IBootstrapper.Default.cs#L128-L161","documentation":"Error \"You must be config storage provider for CAP!\n===================================================================================\n========   eg: services.AddCap( options => { options.UseSqlServer(...) }); ========\n===================================================================================\" thrown in dotnetcore/CAP.","triggerScenarios":"Thrown at src/DotNetCore.CAP/Internal/IBootstrapper.Default.cs:146 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure a storage provider in AddCAP, e.g. services.AddCAP(options => { options.UseSqlServer(connectionString); }); (or UseMySql/UsePostgreSql/UseMongoDB/etc.).","Ensure the storage extension package (e.g. DotNetCore.CAP.SqlServer) is installed and the Use* method is actually invoked inside the AddCAP options lambda."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e52b8508e54cdb7a9ce7f9fec03d9ea8ad2710fb","analyzedAt":"2026-09-14T14:46:34.677Z","contentChangedAt":"2026-09-14T14:46:34.677Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}