Error receiving: CS1061
See Good and Complete Implementation of RSS Feeds in ASP.net MVC
Check out Trevor de Kokekek's answer.
I am getting this error CS1061: "object" does not contain a definition for "Items" and there is no "Items" extension method taking the first argument of type "object" (are you missing a using directive or an assembly reference?)
a source to share
Are you getting this error in the view? In this case, you need to make your view strongly typed with a SyndicationFeed as your model.
This means that you must declare your view (.aspx) as something like strings:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<System.ServiceModel.Syndication.SyndicationFeed>" %>
This tells us that the ViewData.Model is a SyndicationFeed, so you can access its properties and methods without casting.
a source to share
You can get this error if you have an MVC 2 project that was an MVC 3 project at some point.
This happened to me when I had to go back to the MVC 2 version of the MVC 3 project. I deferred my changes to MVC 3.0 and saved the code in TFS (to make fixes for the MVC 2 version), but left the web.config files for my Razor Views. This confused the compiler.
- Find web.config in your directory structure (in Windows Explorer or Visual Studio, "find in files"). Do not use Search in Solution because you might have web.config files that are not present in the project. IIS will load them even if they are not in your solution. Rename any web.config files containing
3.0.0.0
in _web.config and it will stop looking. Then restart IIS.
This should fix the problem.
If you still have the problem, you may need to close all instances of Visual Studio, stop IIS, and delete temporary internet files. You can get the path to this directory by clicking the Show Detailed Compiler link on the error page and selecting temporary.
a source to share