Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6860019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:21:23+00:00 2026-05-27T02:21:23+00:00

hello I am trying to do validation to my form and I obtain this

  • 0

hello I am trying to do validation to my form and I obtain this error!!!

Error 10 The type or namespace name ‘DataAnnotations’ does not exist
in the namespace ‘System.ComponentModel’ (are you missing an assembly
reference?)

How can i fix it?

I use “using System.ComponentModel.DataAnnotations;” in other model and work fine…

but I have this other model:

 public class CompuViewModel 
 {
    public List<Compu> PackageCompu { get; set; }
 }

 public class Compu
 {
    public int Id { get; set; }
    public string Name { get; set; } 
 }

I try to put [Require] in all fields, but throws the error!

Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:21:23+00:00Added an answer on May 27, 2026 at 2:21 am

    You can fix this by stop considering error messages a “bad thing”. Once you do that, you’ll be capable of reading the error message and also understand that it’s simply a good thing that you are seeing it and not the end user.

    The system is trying to help you notice it before it’s too late and even in this particular error, it’s even asking you helpfully “Are you missing an assembly reference” prior to that, it’s even telling you that it’s looking for “DataAnnotations” in “System.ComponentModel” and can’t find it. Now, you need to help it a little.

    So

    1. Actually read the error message
    2. Try to understand what it’s saying
    3. Try to help your program to overcome the problem

    So, it’s looking for DataAnnotations in System.ComponentModel and it’s guessing your missing an assembly reference.

    Now, to add an assembly reference:

    1. Right click your references folder
    2. Add the assembly it’s looking for

    Done

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I'm trying something .. I was reading Jquery traversing documentations some forums, this
Hello there i'm trying to create a form with Zend_Form that will enable my
Hello I am trying to get text to display like it does in terminal
Hello i am trying to find a way to replace this command: Bus_S <=
Hello i'm trying to use autocomplete dropdownlist plugin that name is ufd. Anyway, I
I am trying to do form validation by putting the post values into variables
Hello I have a question with javascript form validation and regular expressions. Below is
Hello I am trying to read a textbox(runatserver) after is gets populated form the
Hello while trying to connect to a derby db i'm getting ERROR XJ040: Failed
hello im trying to set custom errors. i got a form. actions to post.php

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.