Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I currently develop a project in MVC .Net Framework 4.5 now I change my version to 4.0 & I got several errors plz help me to solve this

1.
VB
Error   3   The type or namespace name 'RAMS' could not be found (are you missing a using directive or an assembly reference?)  D:\Avanzar Solution\PROJECT\RAMSSYSTEM\Controllers\HomeController.cs    13  7   RAMSSYSTEM

2.
Error	4	The type name 'TableAttribute' could not be found. This type has been forwarded to assembly 'System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Consider adding a reference to that assembly.	D:\Avanzar Solution\PROJECT\RAMSSYSTEM\Models\AccountModels.cs	21	6	RAMSSYSTEM

3.
Error	4	The type name 'TableAttribute' could not be found. This type has been forwarded to assembly 'System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Consider adding a reference to that assembly.	D:\Avanzar Solution\PROJECT\RAMSSYSTEM\Models\AccountModels.cs	21	6	RAMSSYSTEM



THANKS IN ADVANCE.... :)
Posted

You need to add a reference to System.ComponentModel.DataAnnotation to your project. As for the other issue, if you have multiple projects making up your solution, you will have to convert them all from .NET 4.5 to .NET 4 to work together.
 
Share this answer
 
Comments
Dhruvin Sukhadiya 4-Feb-14 6:39am    
thnx sir but I have already added following references

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Globalization;
using System.Web.Security;
Pete O'Hanlon 4-Feb-14 6:47am    
Those aren't references. Right click on the project references in Solution Explorer and choose "Add reference..." from the context menu.
You are referencing these assemblies somewhere. Remove the reference and it should be fine.

Edit:
Or the other way, as Pete suggested, is to add the required assembly if you are using related classes
 
Share this answer
 
v2
Comments
Dhruvin Sukhadiya 4-Feb-14 6:43am    
oh thanks sir but when i adding it gives errors when i removing it also again errors :)
Ankur\m/ 4-Feb-14 6:55am    
Then you must be doing it in the wrong way. ;)
Follow was Pete has suggested you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900