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?
LVL 10
thefritterfatboyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GavinMannionCommented:
Hi thefritterfatboy,

Yeah OpenWebConfiguration is not a valid syntax in 1.1

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

- Gavin -
thefritterfatboyAuthor Commented:
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.
GavinMannionCommented:
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.
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

thefritterfatboyAuthor Commented:
>>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)
GavinMannionCommented:
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?
thefritterfatboyAuthor Commented:
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.
GavinMannionCommented:
I presume you are using VS 2005. Which will always make version 2.0 applications. Which would explain the web.config

I have never heard of the command aspnet_regiis encrypting web.config's so if it works please post the information here for more users to see. It might be very useful.

Thanks,
Gavin
SwapnilSoftware ArchitectCommented:
Hi thefritterfatboy,

Following will help you.

Encrypting the connection string in ASP.NET V2.0
http://weblogs.asp.net/owscott/archive/2005/07/29/421063.aspx

How To: Encrypt Configuration Sections in ASP.NET 2.0 Using RSA
http://channel9.msdn.com/wiki/default.aspx/Channel9.HowToEncryptConfigurationSectionsUsingRsaInAspNet20?diff=y

Regards,
NetSwap

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.