Debugging HTTP 500 Internal server Error in web applications


The following are the possible reasons to be checked for There may be two <system.web> section in the web.config file Custom configSource pointing config files may not be present in the published directory Enable the <customErrors mode="Off"></customErrors> in the web.config file under the <system.web> section

Encrypting parts of web.config file in asp.net


In order to encrypt the parts of web.config file, esp: connectionStrings section the following command can be executed Note down the name of the site in the IIS Web Server [Ex: ConnectionStringEncryptionTest] Open windows command prompt as an administrator, Execute the following command C:\Windows\system32>%systemroot%\system32\inetsrv\APPCMD list site "ConnectionSt ringEncryptionTest" SITE "ConnectionStringEncryptionTest" (id:4,bindings:http/*:99:,state:Started) CD to the directory … Continue reading Encrypting parts of web.config file in asp.net

To restore a Database from a bak file


In order to restore a database that was backed up from an existing server or a remote server, the following sql command can be used   RESTORE DATABASE [MyDb] FROM DISK='C:\Program Files\Microsoft SQL Server\MSSQL11.LOCAL\MSSQL\Backup\MyDb.bak' WITH MOVE 'MyDb' TO 'C:\Program Files\Microsoft SQL Server\MSSQL11.LOCAL\MSSQL\DATA\MyDbdata.mdf', MOVE 'CelloV45_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL11.LOCAL\MSSQL\DATA\MyDblog.ldf'