Solved

Import System

Posted on 2009-07-06
8
191 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
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…

770 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