About Me

My photo
a Dynamic and Energetic guy.....

Saturday, December 4, 2010

Importance of Web.Config file

<?xml
version="1.0"?>



<configuration>

<appSettings>

<!-- Have to give write permissions for this folder-->

<add
key="LogFilePath"
value="c:\logs\vonquest.web.log"/>

</appSettings>



<connectionStrings>

<!--We can give one or more conncetion strings-->

<add
name="ConnectionString"


connectionString="Data Source=88.88.88.888,555;Integrated Security=True;user=abc;password=abc123;Database=MyDatabase; Trusted_Connection=no"


providerName="System.Data.SqlClient" />

</connectionStrings>



<system.web>

<!--When user's browser in different culture it is difficult to set one specific ciltute-->

<!--To get rid from that problem we can set UICulture & Culture-->

<globalization
uiCulture="en"
culture="en-AU"/>



<compilation
debug="true"
targetFramework="4.0" />



<pages
theme="Default"
enableEventValidation="false"/>

<!--Set the Time Out period-->

<sessionState
mode="InProc"
timeout="20" />



<!--For dissabling errors to end user, we can redirect to an eror page-->

<customErrors
mode="RemoteOnly"
defaultRedirect="~/Errors/GeneralError.aspx" ></customErrors>



<!--We can pick authentication mode (1)Annonymouse (2)Windows (3)Forms-->

<authentication
mode="Forms">

<forms
loginUrl="~/Default.aspx"
defaultUrl="~/Default.aspx" />

</authentication>



<!--Setting no permission for unwanted users, user should log in to the system to view pages -->

<authorization>

<deny
users="?"/>

</authorization>

</system.web>



<location
path="App_Themes">

<system.web>

<authorization>

<allow
users="*"/>

</authorization>

</system.web>

</location>



<location
path="Images">

<system.web>

<authorization>

<allow
users="*"/>

</authorization>

</system.web>

</location>



<location
path="Scripts">

<system.web>

<authorization>

<allow
users="*"/>

</authorization>

</system.web>

</location>



<location
path="favicon.ico">

<system.web>

<authorization>

<allow
users="*"/>

</authorization>

</system.web>

</location>



<!--Setting pages to access any user, no need to log in-->

<location
path="Account/Register.aspx">

<system.web>

<authorization>

<allow
users="*"/>

</authorization>

</system.web>

</location>



<location
path="Errors/GeneralError.aspx">

<system.web>

<authorization>

<allow
users="*"/>

</authorization>

</system.web>

</location>



<location
path="ContactUs.aspx">

<system.web>

<authorization>

<allow
users="*"/>

</authorization>

</system.web>

</location>



<location
path="News.aspx">

<system.web>

<authorization>

<allow
users="*"/>

</authorization>

</system.web>

</location>





<!--Setting up properties to commiunicate with WCF services-->

<system.serviceModel>

<bindings>

<netTcpBinding>

<binding
name="vqNetTcpBinding"
transferMode="Buffered"
listenBacklog="500"
maxBufferPoolSize="30000000"
maxBufferSize="30000000"
maxConnections="500"
maxReceivedMessageSize="30000000">

<readerQuotas
maxDepth="32"
maxStringContentLength="30000000"
maxArrayLength="30000000"
maxBytesPerRead="30000000"
maxNameTableCharCount="30000000" />

<reliableSession
inactivityTimeout="00:01:00"
enabled="true" />

<security
mode="None">

<transport
clientCredentialType="None">

</transport>

</security>

</binding>

</netTcpBinding>

</bindings>

<client>

<!--A= Address, B=Binding ,C=Contract-->

<endpoint
name="NetTcpBinding_IUser"
address="net.tcp://localhost:6000/UserSvc"
binding="netTcpBinding"
bindingConfiguration="vqNetTcpBinding"
contract="VonQuest.Interface.IUser" />

<endpoint
name="NetTcpBinding_IGame"
address="net.tcp://localhost:6001/GameSvc"
binding="netTcpBinding"
bindingConfiguration="vqNetTcpBinding"
contract="VonQuest.Interface.IGame" />

<endpoint
name="NetTcpBinding_IUtility"
address="net.tcp://localhost:6002/UtilitySvc"
binding="netTcpBinding"
bindingConfiguration="vqNetTcpBinding"
contract="VonQuest.Interface.IUtility" />

</client>

</system.serviceModel>

<system.webServer>

<modules
runAllManagedModulesForAllRequests="true"/>

</system.webServer>

</configuration>

No comments:

My Masters