Blog Home  Home | Sign In
  • Add feed to: Add to Google
  • Add to my Yahoo
  • Add to MSN
  • Add to Bloglines
  • Add to Newsgator
  •  Subscribe:Feed your aggregator (RSS 2.0)
InternetWideWorld.com Blog - February, 2007
InternetWideWorld.com powered
 
# Monday, February 26, 2007
I have occasionally received the error "'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!", when migrating code from ASP.NET 1.1 to ASP.NET 2.0.

In the .NET 2.0 framework, as suggested by the error, has been replaced.  If you change your code to use System.Configuration, you will often get another error message "The type or namespace name 'ConfigurationManager' does not exist in the namespace 'System.Configuration' (are you missing an assembly reference?)".
 
This is easily solved by simply adding a reference to System.Configuration to your project.  This is done by selecting Project > Add Reference, and then adding the .NET component entitled "System.Configuration".
 
So, your original code would have been along the lines of:

using System.Configuration;
...
string s = ConfigurationSettings.AppSettings["SomeSetting"].ToString();

Your new code should be along the lines of:
 
using System.Configuration;
...
string s = ConfigurationManager.AppSettings["SomeSetting"].ToString();
Monday, February 26, 2007 10:13:05 PM UTC  #    Comments [0]   Development  | 
# Tuesday, February 20, 2007

I have previously been able to successfully deploy to my computer an IIS application, which is written using the .NET 2.0 framework, that is deployed by using a Microsoft Setup project.  As part of the setup project, it creates a new virtual directory for the IIS application.

Since the last successful deployment, I have installed the .NET 3.0 framework.

When I tried to deploy the project again, using the same setup project, I received the following error:

C:\windows\Microsoft.NET\Framework\v2.0.50727Aspnet_regiis.exe failed to set .net framework script map for W3SVC/1/Root/<virtual folder name> - aborting.

I found that after a bit of investigation that the registration of the .NET framework against IIS was not correct and was causing problems.

As my Web site still required to run under the .NET 2.0 framework, I re-registered the 2.0 framework against IIS, and successfully re-attempted the install.

.Net framework provides an Administration utility that manages the installation and uninstallation of multiple versions of ASP.NET on a single machine. You can find the file in C:\WINNT\Microsoft.NET\Framework\v**\aspnet_regiis.exe

To uninstall current asp.net version

use the command: aspnet_regiis.exe -u

To install current asp.net version

use the command: aspnet_regiis.exe -i

Tuesday, February 20, 2007 3:23:31 PM UTC  #    Comments [0]   Development | Internet  | 
Copyright © 2010 InternetWideWorld.com. All rights reserved.

Pick a theme: