Problems trying to automatically generate views for MVC3, from the controller action method

When I try to create a view from the action method of some controller (right click β†’ Add view β†’ select Strongly typed view) I get the following error:


When starting the templates, there were the following 2 errors:

c: \ Users (...) \ AppData \ Local \ Temp \ b1b5zy30.0.cs (5,33): error CS0234: conversion compilation: The type or name of the namespace 'DataAnnotations' does not exist in the namespace' System.ComponentModel '(do you miss the assembly reference?)

c: \ Users (...) \ AppData \ Local \ Temp \ b1b5zy30.0.cs (6,23): error CS0234: Translation compilation: The type or name of the Linq namespace does not exist in the namespace 'System.Data' ( Do you miss the assembly link?)


Does anyone know what is going on? It worked a couple of days ago, and until I made changes to the MVC installation

thanks

+4
source share
2 answers

Sometimes I got the same error.

  • Go to c:\Users(...)\AppData\Local\Temp\ and delete the .cs files in it.
  • Close VS and stop any server (at startup - in the startup icon you will see the servers that are running), go to %LocalAppData%\Temp\Temporary ASP.NET Files (by typing its address bar Windows-Explorer and Enter) and delete all files and there are folders.
  • Go to %WINDIR%\Microsoft.NET\Framework\v(YOUR-VERSION)\Temporary ASP.NET Files and delete all the files and folders there.
  • A clean and rebuild complete solution.
  • Launch it!

These steps should solve the problem. Check this.

+9
source

This error may occur after installing the T4 material editor ( http://t4-editor.tangible-engineering.com/T4-Editor-Visual-T4-Editing.html ). Uninstalling fixes this problem for me.

/ Emil

+1
source

All Articles