Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# ASP.NET MVC Forms Introducing CRUD Applications Reviewing the List Page

Need help to understand the Index.view error

@model List<Treehouse.FitnessFrog.Models.Entry> . . <div class="pull-right"> <a href="@Url.Action("Edit", new { id = entry.Id })" class="btn btn-warning btn-sm margin-right"> <span class="glyphicon glyphicon-edit"></span><span class="hidden-xs"> Edit</span> </a> <a href="@Url.Action("Delete", new { id = entry.Id })" class="btn btn-danger btn-sm"> <span class="glyphicon glyphicon-trash"></span><span class="hidden-xs"> Delete</span> </a> </div>

I am getting the error in declaring the route values new { id = entry.Id }) Saying cannot assign 'method group' to anonymous type. This gives an error when i try to debug the program setting the breakpoint in Add Action Method {return view}.

Checked stackoverflow they were recommending on adding the model directive, which is already there @model List<Treehouse.FitnessFrog.Models.Entry> also to make sure Entry.Id property is public in entry model. Which is also done.

Can i get some help as to understand why this runtime compilcation error is coming.

Allan Clark
Allan Clark
10,810 Points

could you link to the challenge associated with this question. Also click on 'Markdown Cheatsheet' for help posting formatted code.

1 Answer

this was due to the microsoft code dom compiler version, updated that to fix the issue