Solved

Import System

Posted on 2009-07-06
8
194 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:Starr Duskk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 55

Expert Comment

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

Author Comment

by:Starr Duskk
ID: 24790931
Well, something's changed. I didn't remove an import from all these files and I didn't need it before.
 
0
 
LVL 2

Author Comment

by:Starr Duskk
ID: 24790938
Also, the Dynamic Data that was generated also did not have the Imports in by default, and now it is requiring it.
 
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 20

Accepted Solution

by:
ddayx10 earned 500 total points
ID: 24790997
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
 
LVL 12

Expert Comment

by:funwithdotnet
ID: 24791009
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 2

Author Comment

by:Starr Duskk
ID: 24791311
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 2

Author Closing Comment

by:Starr Duskk
ID: 31600465
you're the winner! :)
0
 
LVL 20

Expert Comment

by:ddayx10
ID: 24791341
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Nested forach loop to linq 3 43
PowerShell:  Use of subproperties in a Select statement 7 69
SSIS Column mapping 5 42
Why am I losing my session variable value 11 40
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 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