.NET Daily

How to solve: An expression tree may not contain a dynamic operation – ASP.NET Core

Introduction

Darius

Darius

Darius Dumitrescu is a creative Senior CMS Consultant with in depth .NET knowledge, focused on Web Development and Architecture Design.


LATEST POSTS

How to use DbContext Scaffold to add only selected tables – ASP.NET Core 01st July, 2019

How to Prevent Visual Studio 2019 to Open a New Browser Instance when Debugging 06th June, 2019

Common .NET Exceptions

How to solve: An expression tree may not contain a dynamic operation – ASP.NET Core

Posted on .

This type of exception usually happens when you forget to declare in the view the model that you plan to use.

In the code of the view, you will see the attributes underlined with a red line, as on the picture from below:

An expression tree may not contain a dynamic operation
An expression tree may not contain a dynamic operation

The solution for this issue is to specify at the top of the page the model you plan to use:

@model TestApp.Models.User

Darius

Darius

Darius Dumitrescu is a creative Senior CMS Consultant with in depth .NET knowledge, focused on Web Development and Architecture Design.

There are no comments.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

View Comments (0) ...
Navigation