Aug 22, 2013

appSettings Configuration Keys ASP.Net


Many of us are aware of appSettings section in configruation file. But ASP.Net has provided few configuration keys which can be used to override default settings by developers while developing applications. These settings can be mentioned in Machine.config. 


Below are few appSettings Configuration Keys:

aspnet:AllowAsyncDuringSyncStages
Description:
Specifies whether ASP.NET will perform extra checks during runtime to catch common mistakes that developers make while performing asynchronous coding.
Remarks:
If this key value is false [default] and the UseTaskFriendlySynchronizationContext key value is true, ASP.NET will perform extra checks during runtime. These checks catch common mistakes that are made in asynchronous coding. Otherwise, no such checks are performed. The checks detect mistakes such as trying to start an asynchronous operation during execution of a synchronous page or causing an IHttpModule or IHttpAsyncHandler to complete when there are still outstanding asynchronous operations. Such mistakes could lead to deadlocks or could hamper performance of an ASP.NET application.
Example:
<appSettings>
      <add key="aspnet:AllowAsyncDuringSyncStages" value="false" />
    </appSettings>
     
   
aspnet:AllowRelaxedHttpUserName
Description:
Specifies how ASP.NET synchronizes the client’s username between the managed (ASP.NET) and native (IIS) layers of the web server.
Remarks:
If this key value is false [default], ASP.NET checks the client’s username before it performs this synchronization step. If this key value is true, ASP.NET performs no check.
Example:
    <appSettings>
      <add key="aspnet:AllowRelaxedHttpUserName" value="false" />    </appSettings>

aspnet:AllowRelaxedRelativeUrl
Description:
Specifies how ASP.NET login pages will redirect to a return URL whose destination is outside the hosted application.
Remarks:
If this key value is false [default], ASP.NET login pages will not redirect to a return URL whose destination is outside the hosted application. If this key value is true, ASP.NET login pages will perform no such check on the return URL and will redirect to it regardless.
Example:
    <appSettings>
      <add key="aspnet:AllowRelaxedRelativeUrl" value="false" />
    </appSettings>

aspnet:AllowRelaxedUnicodeDecoding
Description:
Specifies whether ASP.NET will perform additional Unicode validation on incoming client-supplied data.
Remarks:
If this key value is false [default], ASP.NET will perform additional Unicode validation on incoming client-supplied data. If this key value is true, ASP.NET will not perform extra validation.
Example:
    <appSettings>
      <add key="aspnet:AllowRelaxedUnicodeDecoding" value="false" />
    </appSettings>

aspnet:JavaScriptDoNotEncodeAmpersand
Description:
Specifies whether the default built-in JavaScript string encoding routines will encode the ampersand ('&') character.
Remarks:
If this key value is false [default], the default built-in JavaScript string encoding routines will encode the ampersand ('&') character as "\u0026", which is the JavaScript-escaped form of that character. If key value is true, the default built-in JavaScript string encoding routines will not encode the ampersand character.
Example:
    <appSettings>
      <add key="aspnet:JavaScriptDoNotEncodeAmpersand" value="false" />
    </appSettings>

aspnet:MaxConcurrentCompilations
Description:
Controls parallel compilation of non-dependencies in web directories.
Remarks:
If this key value is "0", all server cores will be used for concurrent compilations. If the key value is "1" [default], concurrent compilations will be disabled. If the key value is "2" or more, concurrent core compilation will be explicitly set to this value and will act as the max value.
Example:
    <appSettings>
      <add key="aspnet:MaxConcurrentCompilations" value="1" />
    </appSettings>

aspnet:MaxHttpCollectionKeys
Description:
Limits the maximum number of items that can be present in any of the client-provided dictionaries of the HttpRequest object.
Remarks:
The client-provided dictionaries include HttpRequest.Files, HttpRequest.Form, HttpRequest.Cookies, HttpRequest.QueryString, HttpRequest.Headers, HttpRequest.ServerVariables.
Example:
    <appSettings>
      <add key="aspnet:MaxHttpCollectionKeys" value="1000" />
    </appSettings>

aspnet:RestrictXmlControls
Description:
Specifies how ASP.NET will load XSLTs.
Remarks:
If this key value is false [default], ASP.NET’s XML controls use XslTransform for XSLT operations. If this key value is true, ASP.NET’s XML controls use XslCompiledTransform for XSLT operations.
Example:
    <appSettings>
      <add key="aspnet:RestrictXmlControls" value="false" />
    </appSettings>

PageInspector:ServerCodeMappingSupport
Description:
Specifies whether the Page Inspector is enabled in Visual Studio.
Remarks:
If the PageInspector:ServerCodeMappingSupport key value is set to Enabled in the Web application, the Page Inspector will be enabled, except if a retail attribute of the deployment element is set to true in the section of the Machine.config file. If the retail attribute is not set in the Machine.config file and the PageInspector:ServerCodeMappingSupport key value is also not set, debug mode will determine whether the Page Inspector is enabled.
Example:
    <appSettings>
      <add key="PageInspector:ServerCodeMappingSupport" value="Disabled" />
    </appSettings>

aspnet:UpdatePanelMaxScriptLength
Description:
Specifies a JSON payload size limit value that the ScriptManager will use to temporarily override the limit that the JavaScriptSerializer will allow when sending large JSON payloads to the client.
Remarks:
The JavaScriptSerializer type has a limit on the maximum JSON payload size it can produce or consume. This limit defaults to 2MB and is configurable via the MaxJsonLength property. The ScriptManager type uses JavaScriptSerializer internally. If this key value is set to a value greater than 0, ScriptManager will temporarily override the limit that the JavaScriptSerializer will allow when sending large JSON payloads to the client, using the provided key value as the JSON payload size limit. If this switch is set to 0, ScriptManager will not override the JavaScriptSerializer default limits.
Example:
    <appSettings>
      <add key="aspnet:UpdatePanelMaxScriptLength" value="0" />
    </appSettings>

Aug 19, 2013

ASP.NET Command-Line Tools


ASP.NET Compilation Tool (Aspnet_compiler.exe)
The ASP.NET Compilation tool (Aspnet_compiler.exe) enables you to compile an ASP.NET Web application, either in place or for deployment to a target location such as a production server. In-place compilation helps application performance because end users do not encounter a delay on the first request to the application while the application is compiled. Compilation for deployment can be performed in one of two ways: one that removes all source files, such as code-behind and markup files, or one that retains the markup files.

Syntax:
aspnet_compiler  [-?][-m metabasePath | -v virtualPath [-p physicalPath]][[-u] [-f] [-d] [-fixednames] targetDir][-c][-errorstack][-nologo][[-keyfile file | -keycontainer container ] [-aptca] [-delaysign]]


Examples:
The following command compiles the WebApplication1 application in place:
Aspnet_compiler -v /WebApplication1
The following command compiles the WebApplication1 application in place, and the tool adds stack trace information if it must report errors.
Aspnet_compiler -v /WebApplication1 -errorstack



ASP.NET Merge Tool (Aspnet_merge.exe)
The ASP.NET Merge tool (Aspnet_merge.exe) enables you to combine and manage assemblies that are created by the ASP.NET Compilation (Aspnet_compiler.exe) tool.

Syntax:
aspnet_merge     [-?] applicationPath[-keyfile filename [-delaysign]][-o assemblyname | -w assemblyname | -prefix prefix][-copyattrs [assemblyfile]][-debug][-nologo][-errorstack][-r][-xmldocs][-a][-logfile logfile][-allowattrs textfile]

Examples:
The following command merges the assemblies of the precompiled site in the C:\PrecompiledSite directory.
Aspnet_merge C:\PrecompiledSite
The following command merges assemblies of a precompiled site in the C:\PrecompiledSite directory and signs the merged assemblies by using the KeyFile.snk file. The merged site will have one assembly for each precompiled site folder.
Aspnet_merge C:\PrecompiledSite -keyfile KeyFile.snk


ASP.NET Browser Registration Tool (Aspnet_regbrowsers.exe)
The ASP.NET Browser Registration tool (Asnet_regbrowsers.exe) parses and compiles all system-wide browser definitions into an assembly and installs the assembly into the global assembly cache. The tool uses the browser definition files (.BROWSER files) from the .NET Framework Browsers subdirectory.

Syntax:
aspnet_regbrowsers.exe

Examples:
To parse and compile all system-wide browser definitions into an assembly and install the assembly into the global assembly cache, run the following command:
aspnet_ regbrowsers.exe -i
You can also use the tool to remove the browser definition assembly from the global assembly cache. The following command removes the browser definitions assembly from the global assembly cache:
aspnet_ regbrowsers.exe -u


ASP.NET IIS Registration Tool (Aspnet_regiis.exe)
The ASP.NET IIS Registration tool (Aspnet_regiis.exe) is used to register ASP.NET applications with Internet Information Services (IIS). This topic describes the options, syntax, and other information for using the tool.
Using the ASP.NET IIS Registration tool, you can perform tasks such as the following:
Register or remove the .NET Framework ASP.NET installation with IIS.
Create new ASP.NET application pools.
Display the status of all installed versions of ASP.NET.

Syntax:
aspnet_regiis [options]

Examples:
The following command installs the ASP.NET version that is associated with the version of the ASP.NET IIS Registration tool that you are using, and updates existing ASP.NET applications. On IIS 6.0, the command updates the scriptmaps of existing ASP.NET applications that are currently mapped to an earlier version of ASP.NET. On IIS 7.0, the command updates both classic mode and integrated mode handlers in the IIS metabase. It also switches the DefaultAppPool and the Classic  .NET AppPool applications pools to use the .NET Framework 4 CLR.
aspnet_regiis -i
The following command installs the ASP.NET version that is associated with the tool without updating existing applications. On IIS 7.0, the command does not update the version of the .NET Framework associated with the DefaultAppPool and Classic .NET AppPool application pools.
aspnet_regiis -ir



ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe)
The ASP.NET SQL Server registration tool (Aspnet_regsql.exe) is used to create a Microsoft SQL Server database that is used by the SQL Server providers in ASP.NET. The tool is also used to add or remove options from an existing database.
You can run Aspnet_regsql.exe without any command-line arguments to run a wizard that will walk you through specifying connection information for your SQL Server installation, and installing or removing the database elements for the membership, role management, profile, Web Parts personalization, and health monitoring features.

Syntax:
Aspnet_regsql.exe

Examples:
To run the wizard, run Aspnet_regsql.exe without any command-line arguments, as shown in the following example.
aspnet_regsql.exe
The ASP.NET SQL Registration tool is commonly used with the -A or -R option to specify which features use a SQL Server provider. The -A option allows you to add support for one or more features, whereas the -R option allows you to remove a feature. The following command installs the database elements for membership and role management on the local computer running SQL Server using Windows authentication.
aspnet_regsql.exe -E -S localhost -A mr

Aug 16, 2013

Alternative to Visual Studio.Net IDE

Below are few alternatives to the Integrated Development Environment (IDE) - Visual Studio for .Net Development

Pao (short for "program as objects") is firstly an idea that a computer program is reprensented totally as objects, as opposed to textual code in the traditional way. This objectization covers all the aspacts of a program, including the internal respresentation, persistance on storage, user interface, editing, debugging, documentation, etc. Pao is a general-purpose programming environment. Currently, it supports microsoft .NET windows application development. Its language(Pao#) covers most sementics of C# (up to v3.5)

MonoDevelop is a cross-platform IDE primarily designed for C# and other .NET languages. MonoDevelop enables developers to quickly write desktop and ASP.NET Web applications on Linux, Windows and Mac OSX. MonoDevelop makes it easy for developers to port .NET applications created with Visual Studio to Linux and Mac OSX maintaining a single code base for all platforms.

CodeRun Studio is a cross-platform Integrated Development Environment (IDE), designed for the cloud. It enables you to easily develop, debug and deploy web applications using your browser. CodeRun Studio can be used instead or alongside your existing desktop IDE. You can upload existing code in order to test it in the cloud or for sharing with your peers.

#develop (short for SharpDevelop) is a free IDE for C#, VB.NET and Boo projects on Microsoft's .NET platform. It is open-source, and you can download both sourcecode and executables from this site. 

Zeus is a fast and lean, fully scriptable, keyboard centric editor packed full of programmer specific features making it one of the best programmer's editor available.

Will try to add few more over coming weeks.