Azure / Azure/azure-functions-openapi-extension

.NET framework Isolated - The system cannot find the file specified.

Open
#641 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
388
Forks
202
PR merge metrics
No merged PRs in 30d

Description

**Describe the issue**
The swagger endpoints do not work for projects that target .net framework isolated.

**To Reproduce**
Steps to reproduce the behavior:
1. Create new Azure Function project that targets .NET framework Isolated v4 with a HttpTrigger function.
2. Add Microsoft.Azure.Functions.Worker.Extensions.OpenApi package
3. Modify program.cs according to the docs
```
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults(worker => worker.UseNewtonsoftJson())
```
4. Add decorator the function app (Taken from the docs)
```
[OpenApiOperation(operationId: "greeting", tags: new[] { "greeting" }, Summary = "Greetings", Description = "This shows a welcome message.", Visibility = OpenApiVisibilityType.Important)]
[OpenApiSecurity("function_key", SecuritySchemeType.ApiKey, Name = "code", In = OpenApiSecurityLocationType.Query)]
[OpenApiResponseWithBody(statusCode: HttpStatusCode.OK, contentType: "text/plain", bodyType: typeof(string), Summary = "The response", Description = "This returns the response")]
```
6. Start project
7. Navigate to http://localhost:xxx/api/swagger/ui
8. See error: The system cannot find the file specified.

**Screenshots**

![image](https://github.com/Azure/azure-functions-openapi-extension/assets/16224711/5ecdcc9a-bb22-4d88-bbdf-9dae0187ccca)

**Environment (please complete the following information, if applicable):**
- OS: Windows
- Core Tools Version: 4.0.5455 Commit hash: N/A (64-bit)
- Function Runtime Version: 4.27.5.21554

```xml


net48
v4
Exe











PreserveNewest


PreserveNewest
Never




```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.