Logo 
Search:

Asp.net MVC Articles

Submit Article
Home » Articles » Asp.net MVC » Errors and SolutionRSS Feeds

Error: "Unsupported Context Type" when trying to add new controller.

Posted By: Vivek Patel     Category: Asp.net MVC     Views: 9311

Error: "Unsupported Context Type" when trying to add new controller.
 



Cause of Error: This error occurs when you try to reference context class for models and model class for data context class.  

If you have carefully noticed figure 2, you will notice that while adding new controller by mistake 
  1. I am referencing Context class for model and
  2. For Data Context class i am referencing model class.
Now this is what causing error. "Unsupported Context Type".
 

Solution:  Since you have reference the classes incorrectly as describe above you need to make correct referencing appropriately, as shown in figure.
  1. Reference Model class for model and
  2. For Data Context class for Data Context class.
Correcting the ordering of classes will fix this error.
  
Share: 



Vivek Patel
Vivek Patel author of Error: "Unsupported Context Type" when trying to add new controller. is from United States. Vivek Patel says

I have started working in .Net Technology since its beta release and lucky to got chance to work on .Net 1.1, 2.0 and now working on .Net 3.5. I have worked in both C# and VB.Net for Asp.net Projects. I can also provide Sharepoint development needs. I can efficiently switch role from Tech Lead and Developer. I have comprehensive knowledge of Asp.net Development. I have been award Microsoft Most Valuable Award twice in Asp.net Technology.

Blog: http://dotnetguts.blogspot.com

 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!