I have a razorview which uses a layout with name ReportsLayout. I was pulling configuration strings by injecting IConfiguration into the Layout as well as page views as below.
_Layout View
@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration
Page View
@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration
@model DayFuelSalesView
@{ Layout = "~/Views/Shared/_ReportsLayout.cshtml"; }
It was working fine until I added some more code to the razorview page which is basically pure html code.
After adding the code, during the debugging, the debugger show error as below in the web browser while trying to open the page.

This is the first time I am seeing such kind of error and I am unable to get it to work. Any help is appreciated.