Solved

Import System

Posted on 2009-07-06
8
193 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
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
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 
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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 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