Solved

Import System

Posted on 2009-07-06
8
188 Views
Last Modified: 2013-11-08
Up until recently, I've been running my web app fine. But now all of a sudden, I have to import System and Import System.Web.Ui and such on every form it seems.

What would have changed?

Always been using VS2008 and 3.5 framework SP1. Nothing's changed that I know of.

thanks.
0
Comment
Question by:BobCSD
8 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
Comment Utility
I cannot imagine a code without import System.
System.Web.UI shall be expected if you are coding asp pages.
0
 
LVL 1

Author Comment

by:BobCSD
Comment Utility
Well, something's changed. I didn't remove an import from all these files and I didn't need it before.
 
0
 
LVL 1

Author Comment

by:BobCSD
Comment Utility
Also, the Dynamic Data that was generated also did not have the Imports in by default, and now it is requiring it.
 
0
 
LVL 20

Accepted Solution

by:
ddayx10 earned 500 total points
Comment Utility
In VB.NET you get some namespaces declared for free. These are defined in the <namespaces> node of the web.config. I would guess that something has caused the default template for your web.config to change, and or someone has modified the web.config you are using. Otherwise I am guessing some sort of corruption I haven't seen before or an install of a framework component that was installed had unexpected results...

I'm guessin it's just the web.config <namespaces> node...take a look this is what VS puts into my web.config by default:

            <pages>
                  <namespaces>
                        <clear/>
                        <add namespace="System"/>
                        <add namespace="System.Collections"/>
                        <add namespace="System.Collections.Generic"/>
                        <add namespace="System.Collections.Specialized"/>
                        <add namespace="System.Configuration"/>
                        <add namespace="System.Text"/>
                        <add namespace="System.Text.RegularExpressions"/>
                        <add namespace="System.Linq"/>
                        <add namespace="System.Xml.Linq"/>
                        <add namespace="System.Web"/>
                        <add namespace="System.Web.Caching"/>
                        <add namespace="System.Web.SessionState"/>
                        <add namespace="System.Web.Security"/>
                        <add namespace="System.Web.Profile"/>
                        <add namespace="System.Web.UI"/>
                        <add namespace="System.Web.UI.WebControls"/>
                        <add namespace="System.Web.UI.WebControls.WebParts"/>
                        <add namespace="System.Web.UI.HtmlControls"/>
                  </namespaces>
                  <controls>
                        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                  </controls>
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 12

Expert Comment

by:funwithdotnet
Comment Utility
Could be a corrupted file, bad reference, etc. Sometimes stuff happens.  I seem to recall a similar issue. Even though you shouldn't have to, you might try adding the necessary references to the project(s). Right-click on your procect in Solution Explorer, select 'Add Reference'. Under the '.NET' tab, select the desired namespace(s).
0
 
LVL 1

Author Comment

by:BobCSD
Comment Utility
ddayx,
I see it now.
This is my web.config:

<namespaces>
<add namespace="System" />
<add namespace="System.Collections.Generic" />
<add namespace="System.Data" />
<add namespace="System.Data.SqlClient" />
<add namespace="System.Web.Security" />
<add namespace="System.Web.UI" />
<add namespace="System.Web.UI.WebControls" />
<clear />
<add namespace="System.Collections" />
<add namespace="System.Collections.Specialized" />
 
Notice the <clear/> stuck in there. Don't know how that got there!
The ones above it are all the "missing" ones.
Thanks for the help! That did it! Finally! Adding Imports for those 7 namespaces was driving me nuts! And I was no where near finished!
Thanks!
 
 
0
 
LVL 1

Author Closing Comment

by:BobCSD
Comment Utility
you're the winner! :)
0
 
LVL 20

Expert Comment

by:ddayx10
Comment Utility
awesome :) good job ....??how did that get in there lol... I'd be making fun of someone in the office tommorrow for doing that (assuming that implies here).
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now