-
Notifications
You must be signed in to change notification settings - Fork 494
Description
Description
Can't make request to lambda using Mock Lambda Test Tool when project has reference to Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation Nuget package.
Reproduction Steps
-
Install templates:
dotnet new -i "Amazon.Lambda.Templates::*" -
Create new project:
dotnet new serverless.AspNetCoreWebApp -
Add Nuget reference to
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation -
Edit
ConfigureServicesin startup to enable razor pages to be loaded:public void ConfigureServices(IServiceCollection services) { services.AddControllers(); var builder = services.AddRazorPages(); builder.AddRazorRuntimeCompilation(); } -
Configure debug configuration for mock test tool as shown in the readme for Rider:
Executable and executable path: "\.dotnet\tools\.store\amazon.lambda.testtool-3.1\0.11.4\amazon.lambda.testtool-3.1\0.11.4\tools\netcoreapp3.1\any\Amazon.Lambda.TestTool.BlazorTester.dll" -
Create a controller and use attribute routing
-
Debug application and send in request using Mock Test Tool blazor interface
Request I'm using: { "httpMethod": "GET", "path": "/api/Home" }
Logs
Environment
- Build Version: Amazon.Lambda.AspNetCoreServer 7.0.1
- OS Info: Windows 10
- Build Environment: Jetbrains Rider
- Targeted .NET Platform: netcoreapp3.1
Resolution
- Remove reference to Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (no use for local debugging)
A similar issue also happens when I reference Microsoft.AspNetCore.Mvc.WebApiCompatShim too, but the error is that it can't find System.Json.
This is a 🐛 bug-report

