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

No comments:

Post a Comment