{"record":{"id":"8c6cfe0cdc6bb714","repo":"microsoft/semantic-kernel","slug":"apimanifest-file-not-found-filepath","errorCode":null,"errorMessage":"ApiManifest file not found: {filePath}","messagePattern":"ApiManifest file not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs","lineNumber":111,"sourceCode":"    /// <returns>A task that represents the asynchronous operation. The task result contains the created kernel plugin.</returns>\n    public static async Task<KernelPlugin> CreatePluginFromApiManifestAsync(\n        this Kernel kernel,\n        string pluginName,\n        string filePath,\n        string? description,\n        ApiManifestPluginParameters? pluginParameters = null,\n        CancellationToken cancellationToken = default)\n    {\n        Verify.NotNull(kernel);\n        KernelVerify.ValidPluginName(pluginName, kernel.Plugins);\n\n#pragma warning disable CA2000 // Dispose objects before losing scope. No need to dispose the Http client here. It can either be an internal client using NonDisposableHttpClientHandler or an external client managed by the calling code, which should handle its disposal.\n        var httpClient = HttpClientProvider.GetHttpClient(pluginParameters?.HttpClient ?? kernel.Services.GetService<HttpClient>());\n#pragma warning restore CA2000\n\n        if (!File.Exists(filePath))\n        {\n            throw new FileNotFoundException($\"ApiManifest file not found: {filePath}\");\n        }\n\n        var loggerFactory = kernel.LoggerFactory;\n        var logger = loggerFactory.CreateLogger(typeof(ApiManifestKernelExtensions)) ?? NullLogger.Instance;\n        using var apiManifestFileJsonContents = DocumentLoader.LoadDocumentFromFilePathAsStream(filePath,\n            logger);\n        JsonDocument jsonDocument = await JsonDocument.ParseAsync(apiManifestFileJsonContents, cancellationToken: cancellationToken).ConfigureAwait(false);\n\n        ApiManifestDocument document = ApiManifestDocument.Load(jsonDocument.RootElement);\n\n        var functions = new List<KernelFunction>();\n        var documentWalker = new OpenApiWalker(new OperationIdNormalizationOpenApiVisitor());\n        foreach (var apiDependency in document.ApiDependencies)\n        {\n            var apiName = apiDependency.Key;\n            var apiDependencyDetails = apiDependency.Value;\n\n            var apiDescriptionUrl = apiDependencyDetails.ApiDescriptionUrl;","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs#L93-L129","documentation":"Thrown by ApiManifestKernelExtensions when the `filePath` passed to the ApiManifest plugin registration does not exist (File.Exists returns false). The method then attempts to load and parse the ApiManifest JSON, so it refuses to proceed on a missing file rather than letting the stream reader throw a less clear error.","triggerScenarios":"Calling `kernel.CreatePluginFromApiManifestAsync(filePath, pluginName)` with a wrong, relative-but-misresolved, or non-deployed ApiManifest file path.","commonSituations":"Path relative to the wrong working directory; manifest file not copied to output; typo in filename; environment-specific path that differs across machines.","solutions":["Verify File.Exists(filePath) before calling and log the resolved absolute path.","Build the path from AppContext.BaseDirectory for deployed apps.","Ensure the manifest is included as content copied to the output directory in your .csproj."],"exampleFix":"// before\nawait kernel.CreatePluginFromApiManifestAsync(@\"./apimanifest.json\", \"api\");\n// after\nvar path = Path.Combine(AppContext.BaseDirectory, \"apimanifest.json\");\nawait kernel.CreatePluginFromApiManifestAsync(path, \"api\");","handlingStrategy":"validation","validationCode":"if (!File.Exists(filePath))\n    throw new InvalidOperationException($\"ApiManifest missing: {Path.GetFullPath(filePath)}\");\nawait kernel.CreatePluginFromApiManifestAsync(filePath, pluginName);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ship the manifest as content copied to the output directory.","Root manifest paths at AppContext.BaseDirectory."],"tags":["openapi","apimanifest","plugin","file-not-found","configuration"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}