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 6090107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:10:34+00:00 2026-05-23T12:10:34+00:00

Setup: An MVC 3 app I am working on suddenly won’t compile. I get

  • 0

Setup:

An MVC 3 app I am working on suddenly won’t compile. I get the following error:

The type ‘System.Web.UI.Control’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’.

This is clearly absurd: I have System.Web version 4.0.0.0 on my machine.

If I remove the code at the relevant line, the error simply moves to the next line.

Visual Studio had been complaining about an add in, eg, if I was trying to Go To Definition, VS would complain and ask if I wanted to remove the add in.

Questions:

Is VS mangled?

Do I need to reinstall the whole bally thing (VS 2010, power tools, MVC 3 and heck knows what else)?

EDIT:

Since finding the cause and therefore solving the issue, I have renamed the question to a name that is more likely to be found by others with the same or similar problem.

To the best of my abilities, my answer tells how to troubleshoot this issue. But if anyone can come up with a full explanation for this issue, then I will gladly mark that as the answer.

  • 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-23T12:10:34+00:00Added an answer on May 23, 2026 at 12:10 pm

    OK, I have got to the bottom of this.

    The problem was that I was using some string extensions. These were packed in a library, written ages ago.

    The issue is caused by the namespace. Lets call it WS.Extensions

    In WS.Extensions I also had some extension methods for plain vanilla asp.net server controls, and the classes these extensions are in have using statements for System.Web.UI.

    Although the relevant dlls are referenced in the library project, it seems that this causes issues with MVC 3 and, to my mind, an obscure error. Obvious once you know where the issue lies, but not otherwise.

    I have moved all the extensions to a new library with no cross using statements that reference server control namespaces such as System.Web.UI.

    I have not deleted my post as I think that the problem could happen to others moving from the horrors of server controls to MVC.

    Addendum:

    The nasty thing of this error is that it shows as a compiler error, with a specific line where the “problem” is. Commenting out this line just moves the line that the compiler complains about down one line. Also, the line had absolutely NOTHING to do with the lines where the extensions were used. So there were no clues.

    As a result, I would consider this to be a compiler bug, that has nothing to do with ASP.NET MVC, 3 or otherwise.

    It is caused by referencing (using) a namespace from and ASP.NET MVC 3 app, when that namespace includes code that is written for ASP.NET server controls.

    I lost half a day on the problem, so hope that this helps someone else. As a result, have renamed the question.

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

Sidebar

Related Questions

I'm trying to get a first Spring 3 MVC setup running. My app is
I have a MVC app and using JQuery. I have anchor that I setup
I would like to setup a multi-tenant ASP.NET MVC app. Ideally, this app would
I have an MVC 1.0 app just setup but it only shows the Index.aspx
Ok i have an mvc app. and im trying to get my delete to
Hi I'm using ninject with an MVC app. I'm sure I have it setup
I have been working on an MVC 3 app. I was using VS 2010's
I'm trying to get my spring application working, following a guy who posted an
I'm new to MVC land, and have an app that i'm working on. i
I am currently working on an ASP.NET MVC 3 app where I have a

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.