Link to home
Start Free TrialLog in
Avatar of thefritterfatboy
thefritterfatboy

asked on

Change ASP.Net version in Visual Studio 2005

I'm assuming my problem lies with originally choosing to run my web application under ASP.Net 1.1 because when I add this line:

Dim config As Configuration = ConfigurationManager.OpenWebConfiguration(Request.ApplicationPath)

'OpenWebConfiguration' is not a member of 'System.ConfigurationManager'

Which is likely to be due to the fact OpenWebConfiguration was added in .Net 2.0

How would I go about changing the version of a current project?
Avatar of GavinMannion
GavinMannion

Hi thefritterfatboy,

Yeah OpenWebConfiguration is not a valid syntax in 1.1

What are you trying to do? Get the configuration settings?

- Gavin -
Avatar of thefritterfatboy

ASKER

Yeah, I want to grab all the connection strings and encrypt them in the web.config file.

Ideally, I'd like the version to be updated if it is that that is causing the problem.
So you want to read them from the web.config - encrypt them and write them back?

If you do that it will cancel all the current sessions and the app will most probably fall over...

To get config settings from the web.config you would use this syntax in 1.1

ConfigurationSettings.AppSettings["ConnectionStringName"]

I have a feeling you are trying to use 2.0 features in 1.1. In 1.1 there is no setting in the web config for Connection Strings and the web.config should not be edited by the application it supports.
>>If you do that it will cancel all the current sessions and the app will most probably fall over...<<

The app is not currently live.

For some reason the web.config file is in the .Net V2.0 schema (Vis Studio created it like that)
So you have a 1.1 application running off a 2.0 web.config?

Not sure how well that is going to handle... but anyway.

So you are just trying to encrypt the connection string? Why not just do that 'manually' and update the web.config using notepad then?

When I say manually I mean cut the connection string and run it through your encryption algorythmn and then paste the answer back?
ASP.Net has integrated methods of encrypting. I have just found that you can do it using aspnet_regiis.exe so I will look into that.

As for the config file - I have no idea why Visual Studio has created a v2.0 web.config file. I just tried to create a new asp.net application and it never prompted me for asp.net version.
SOLUTION
Avatar of GavinMannion
GavinMannion

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Swapnil
Swapnil
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial