Monday, December 4, 2017

Exclude ELMAH 404 errors reporting

                                 Recently we have faced a situation that receiving lots of 404 errors for a xx\xx path not found due to vulnerabilities scan software run against our web application. Since these errors raised by vulnerabilities scan software , we no need to concern and not required to log . So we decided to stop ELMAH reporting this error.

 I have done some analysis to find the best way to exclude these types of errors from being reporting. Here is the working solution I made with simple configuration changes in the  <elmah> section of web.config as specified below

Friday, March 17, 2017

How to Disable Protected View in Microsoft Excel

You may experience this Alert message, when you work with excel files which are downloaded from internet or other sources

There are different ways to work  around this issue:

Solution #1 ( Preferred )
The simplest and most secure method to get around this issue is to simply click the Enable Editing button, on a per-document basis, when you open an Excel (or other Microsoft office) file that has been downloaded.

Solution #2 ( Not Preferred )

Alternatively, you can choose to disable the Protected View feature within Excel so that you no longer recieve the warning upon opening any Excel file that has been downloaded.

In Excel
-> go to File
-> Options
-> Trust Center
-> Trust Center Settings
- > Protected View, and then
->uncheck Enabled Protected View for files originating from the Internet.

There is also, in Trust Center Settings, a Macro Setting that you can use to Enable All Macros by default

Note:Be aware that enabling this feature allows potentially dangerous code to run.If either of these Trust Center settings are changed, you need to be very careful about the Excel files which are opened

Friday, February 17, 2017

Cannot execute script: Insufficient memory to continue the execution of the program

                             Recently i have faced this error when i am trying to execute large insert script file with SQL Management Studio. Sometimes, due to the heavy size of the script and data, we encounter this type of error. Server needs sufficient memory to execute and give the result.There are two possible options you can try to resolve

Option #1:

  •  Open cmd.exe as Administrator.
  •  Create Documents directory.
  •  Put your SQL Script file(script.sql) in the documents folder.
  • Type query with sqlcmd, server-name, database-name and script-file-name as like above highlighted query or below command line screen.

sqlcmd -S server-name -d database-name -i script.sql

You can also simply increase the Maximum Server Memory value in server properties. To edit this setting, right click on server name and select Properties > Memory tab.


Thursday, January 12, 2017

There was no endpoint listening at (url) that could accept the message

                                                               Recently I got this exception .When I was trying to call a WCF service hosted in a new server from a Web application in my local. I got the error below

There was no endpoint listening at http://localhost:[number]/XXXXX.svc that could accept the

message. This is often caused by an incorrect address or SOAP action. See InnerException,

if present, for more details.

Initially i thought that some configuration went wrong .After investigation i found that we need to disable the default proxy.I have  added below config settings  in  the Web.config of service host project. After that everything worked perfectly !!!

    <defaultproxy enabled="false">