I want to debug with hot reload enabled using VSCode. I keep getting this error after I made some changes:
BadImageFormatException: Bad IL range. OTPHub.Pages.Counter..ctor()
TargetInvocationException: Exception has been thrown by the target ofan invocation. System.RuntimeType.CreateInstanceDefaultCtor(boolpublicOnly, bool wrapExceptions)
It seems that there is a problem with the hot reloaded built assembly.
Here is my launch.json:
{"version": "0.2.0","configurations": [ {"name": ".NET Core Launch (web)","type": "coreclr","request": "launch","preLaunchTask": "build","program": "dotnet","args": ["watch","--project",".","--verbose" ],"cwd": "${workspaceFolder}/OTPHub","stopAtEntry": false,"serverReadyAction": {"action": "openExternally","pattern": "\\bNow listening on:\\s+(https?://\\S+)" },"env": {"ASPNETCORE_ENVIRONMENT": "Development" },"sourceFileMap": {"/Views": "${workspaceFolder}/Views" } }, {"name": ".NET Core Attach","type": "coreclr","request": "attach" } ]}Should change something from this launch.json setting? How can I debug it with hot reload enabled?