Visual Studio throws output: RuntimeBinderException dereferencing ViewBag.property on MVC 5 Razor page

I am using ASP.NET MVC 5 with Entity Framework 6

Today I updated some components using NuGet (for example, MVC 5.2.0.0 updated to MVC 5.2.2.0 ), also updated EF6 to the new version along with other components.

But now the Visual Studio output window always displays :

First random type exception

'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll

Then I open the exceptions panel and select Normal language time exception (on Visual Studio 2013: press Ctrl + Alt + E), then I find the source from my Razor page for each ViewBag

 ViewBag.Title = Resource.ApplicationName; 

My project razor page uses all the properties of the ViewBag, so sometimes I see a lot of RuntimeBinderException events. It only outputs - never starts anything - until I checked the Common Language runtime exception in Visual Studio

So what is going on? Is there anyway to hide it? Why is it displayed now? Why hasn't this been displayed before?

+5
source share

Source: https://habr.com/ru/post/1212326/


All Articles