Aaron Li's Blog

Write it down before I forget

  Home  |   Contact  |   Syndication    |   Login
  30 Posts | 0 Stories | 21 Comments | 1 Trackbacks

News

Google

Archives

Other's Idea

Convert A Web Project From ASP.NET 1.1 to 2.0 (1)

 

While trying to build a web project converted from Visual Studio 2003 to 2005, I have encountered some issues.

 

1. AppSettings

 

In ASP.NET 1.1, AppSettings is a method of ConfigurationSettings class which is in the System.Configuration namespace; in 2.0, I get a warning on ConfigurationSettings.AppSettings:

 

"This method is obsolete, it has been replaced by System.Configuration! System.Configuration.ConfigurationManager.AppSettings”

 

After changing ConfigurationSettings.AppSettings to ConfigurationManager.AppSettings, it says

 

“Name 'ConfigurationManager' is not declared.”

 

At the beginning of the file, I already have the directive

using System.Configuration;

 

By explicitely adding the reference to System.configuration.dll, this problem is solved.

 

2. ListItem

 

I’ve got errors saying

 

“Type 'ListItem' is not defined. ”

 

The directive “using System.Web.UI.WebControls” is there, then why? Adding the reference to System.Web.dll removes this error.

In ASP.NET 2.0, when a new project (mine is a Class Library) is created, System.dll, System.Data.dll, and System.XML.dll are automatically referenced; as a result, we have to manually add any other reference if we want to use the types in that assembly.

 

posted on Wednesday, March 07, 2007 3:36 PM

Feedback

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: