microsoft/semantic-kernel · error · FileNotFoundException
No .proto document for the specified path - {filePath} is fo
Error message
No .proto document for the specified path - {filePath} is found. What it means
Thrown by `Kernel.CreatePluginFromGrpc` (the directory-overload) when no `grpc.proto` file exists inside the computed plugin directory. The method builds `parentDirectory/pluginDirectoryName/grpc.proto` and checks File.Exists before opening; a missing file is treated as a deployment/setup error.
Source
Thrown at dotnet/src/Functions/Functions.Grpc/Extensions/GrpcKernelExtensions.cs:107
/// <param name="executionParameters">Optional gRPC function execution parameters.</param>
/// <returns>A list of all the prompt functions representing the plugin.</returns>
public static KernelPlugin CreatePluginFromGrpcDirectory(
this Kernel kernel,
string parentDirectory,
string pluginDirectoryName,
GrpcFunctionExecutionParameters? executionParameters = null)
{
const string ProtoFile = "grpc.proto";
KernelVerify.ValidPluginName(pluginDirectoryName, kernel.Plugins);
var pluginDir = Path.Combine(parentDirectory, pluginDirectoryName);
Verify.DirectoryExists(pluginDir);
var filePath = Path.Combine(pluginDir, ProtoFile);
if (!File.Exists(filePath))
{
throw new FileNotFoundException($"No .proto document for the specified path - {filePath} is found.");
}
if (kernel.LoggerFactory.CreateLogger(typeof(GrpcKernelExtensions)) is ILogger logger &&
logger.IsEnabled(LogLevel.Trace))
{
logger.LogTrace("Registering gRPC functions from {0} .proto document", filePath);
}
using var stream = File.OpenRead(filePath);
return kernel.CreatePluginFromGrpc(stream, pluginDirectoryName, executionParameters);
}
/// <summary>
/// Imports gRPC document from a file.
/// </summary>
/// <param name="kernel">The <see cref="Kernel"/> containing services, plugins, and other state for use throughout the operation.</param>
/// <param name="filePath">File path to .proto document.</param>View on GitHub (pinned to c028a0c7dc)
Solutions
- Confirm the directory contains a file named exactly `grpc.proto`.
- Check the resolved `pluginDir` path (parentDirectory + pluginDirectoryName) is what you expect.
- Ensure the .proto file is marked 'Copy to Output Directory' in your .csproj.
Example fix
// before kernel.CreatePluginFromGrpc(@"./plugins", "math"); // after // verify ./plugins/math/grpc.proto exists, then: kernel.CreatePluginFromGrpc(@"./plugins", "math");
Defensive patterns
Strategy: validation
Validate before calling
var protoPath = Path.Combine(parentDirectory, pluginDirectoryName, "grpc.proto");
if (!File.Exists(protoPath))
throw new InvalidOperationException($"Expected .proto at {protoPath}");
kernel.CreatePluginFromGrpc(parentDirectory, pluginDirectoryName); Prevention
- Mark .proto files as CopyToOutputDirectory in .csproj.
- Log the resolved plugin directory during startup.
When it happens
Trigger: Calling `kernel.CreatePluginFromGrpc(parentDir, pluginName)` where the plugin folder lacks a `grpc.proto`, or the folder name is misspelled so the resolved path is wrong.
Common situations: Wrong working directory / relative path; plugin assets not copied to the output directory; renamed plugin folder; case-sensitive filesystem mismatch.
Related errors
- ApiManifest file not found: {filePath}
- Configuration not found, please setup the notebooks first us
- Function {targetFunction} not found in plugin {this.Name}
- No address provided for the '{operation.Name}' gRPC operatio
- The address '{address}' for the '{operation.Name}' gRPC oper
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/63ac084ae27efbf6.
Report an issue: GitHub.