I created a project in Visual Web Developer 2008. (Visual Basic -> Web -> ASP.NET Web Application). Name of the Project is PFMS and it is located at c:\inetpub\ I did not check Create Directory for solution
In this project, I have written code in the file connect.aspx.vb as follows:
When I run this code with Debug -> Start Debugging, code executes without error up to this line:
But when I press F8 on this line:
I receive the error message:
A configuration file cannot be created for the requested Configuration object.
Based on what I had searched to resolve this issue, I tried the following but there was no success:
Selected the folder c:\inetpub\Right-Click -> Properties -> Web Sharing
Selected Share this folder
An Edit Alias dialog box appeared
Clicked OK
A message appeared: The alias /Root/Pfms already exists. Please choose a different alias. So I renamed the alias to Pfms2, clicked OK, OK.
I am using Windows XP Service Pack 2. ASP.NET version is 2.0.50727. My own machine is also the server for this application.
In this project, I have written code in the file connect.aspx.vb as follows:
Code:
Public Partial Class connect
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim cn As New ConnectionStringSettings()
cn.ConnectionString = _
"Data Source=developers;User ID=abc;Password=123;" & _
"Persist Security Info=True"
cn.Name = "pfms"
cn.ProviderName = "MSDAORA.1"
Dim config As System.Configuration.Configuration = _
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/pfms")
config.ConnectionStrings.ConnectionStrings.Add(cn)
config.Save()
End Sub
End Class
When I run this code with Debug -> Start Debugging, code executes without error up to this line:
Code:
config.ConnectionStrings.ConnectionStrings.Add(cn)
But when I press F8 on this line:
Code:
config.Save()
I receive the error message:
A configuration file cannot be created for the requested Configuration object.
Based on what I had searched to resolve this issue, I tried the following but there was no success:
Selected the folder c:\inetpub\Right-Click -> Properties -> Web Sharing
Selected Share this folder
An Edit Alias dialog box appeared
Clicked OK
A message appeared: The alias /Root/Pfms already exists. Please choose a different alias. So I renamed the alias to Pfms2, clicked OK, OK.
I am using Windows XP Service Pack 2. ASP.NET version is 2.0.50727. My own machine is also the server for this application.