Solved

Import System

Posted on 2009-07-06
8
189 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 1

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 1

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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 1

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 1

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
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 …

943 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

10 Experts available now in Live!

Get 1:1 Help Now