I create a web application and a windows application using visual studio 2005 .net 2.0 and sql server2005 and OS is windows xp sp2
My web application runs fine at my system also windows application does not have any error at my end.
Now then i install that same web application and windows application at my client system he is using .net 2.0 with windows server 2003
his web application is running fine without any error but windows application when started giving message box like -
"The specified argument is out of range. Parameter name : site"
i thought that this error was comes at time reading my web.config in windows application (i need to read web.config for connection to sql server)
This is code of windows application-
Imports System.Web.Configuration
......
Public Class Form1
...
...
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
....
Dim Str1 As Configuration.Configuration = WebConfigurationManager.OpenWebConfiguration("\myvirtualdirectory\")
Try
Value = Str1.ConnectionStrings.ConnectionStrings("Conn").ConnectionString
Catch exa As Exception
MsgBox("Error at reading Configuration :" & vbCrLf & exa.Message.ToString)
Me.lblShowError.Text = "Configuration not read"
Exit Sub
End Try
....
End Sub
.....
End Class
And here is my web.config which can be find in "c:\inetpub\wwwroot\myvirtualdirectory" folder-
<configuration> <xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<connectionstrings>
<remove name="LocalSqlServer">
<add name="LocalSqlServer" connectionstring="Data Source=localhost;Initial Catalog=ASPNETDB;Persist Security Info=True;integrated security=true" providername="System.Data.SqlClient"></add>
<add name="rptServerName" connectionstring="http://localhost/reportServer"></add>
<add name="Conn" connectionstring="Data Source=localhost;Initial Catalog=dbname;Persist Security Info=True;User ID=imuser;Password=pwd;" providername="System.Data.SqlClient"></add>
</remove>
<system.web>
<identity impersonate="true"></identity>
<sessionstate timeout="100" mode="InProc" stateconnectionstring="LocalSqlServer" cookieless="false">
<authentication mode="Forms">
<forms name="form1" loginurl="index.aspx" protection="All">
<credentials passwordformat="Clear">
<user name="abc" password="xyz"></user>
</credentials>
</forms>
</authentication>
<authorization>
<allow verbs="enterSharedScope" users="*" roles="Admin"></allow>
</authorization>
<httphandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"></add>
</httphandlers>
<compilation debug="true">
<assemblies>
<add assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"></add>
<add assembly="Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"></add>
<buildproviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"></add>
</buildproviders>
</assemblies>
</compilation>
</sessionstate></system.web></connectionstrings></configuration>
But i don't think it will help you because seems problem is not with web.config as my site is running well with iis on same machine (also Let you know that on other machine i install with windows 2003 server at my end same application is running successfully) but at client end it not run. then i find word site in my code of windows app. (in vs 2005) then i got it in app.menifest.
here is whole manifest as it is-
<asmv1:assembly manifestversion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<trustinfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<applicationrequestminimum>
<defaultassemblyrequest permissionsetreference="Custom">
<permissionset class="System.Security.PermissionSet" version="1" unrestricted="true" id="Custom" samesite="site"></permissionset>
</defaultassemblyrequest>
</applicationrequestminimum>
</security>
</trustinfo></asmv1:assembly>
So if i remove the commented text in app.manifest then also no change in error. and if i remove app.menifest from my project then the error message not appear but application is also not run
means no run, no error
i appreciate any help in this !