When I upgraded to ASP.NET 4.0, runtime errors suddenly became very slow. There was a consistent two-minute delay before my custom error page would appear. The rest of the website was lightning fast, so it was not related to compilation. I finally decided to tackle this problem, so I started copying blocks of code into a new, blank custom error page. The delay was not present until I copied this line of code:
Response.StatusCode = 500
I had been searching the web for terms like "asp.net error page very slow" with no success. One quick search on "asp.net statuscode slow" finally returned some helpful results:
All I had to do was drop in one line of code where I set the status code.
Response.TrySkipIisCustomErrors = True
The delay is gone now, but I still have no idea what's going on inside the black box.
IIS Crypto is a free tool that gives administrators the ability to enable or disable protocols, ciphers, hashes and key exchange algorithms on Windows Server 2003 and 2008. It also lets you re-order SSL cipher suites offered by IIS.
Test your certificate chain: SSL Test
As far as I can tell, it is trivial to enable multiple simultaneous remote desktop sessions for Windows Server 2008.
- Open gpedit.msc
- Navigate to Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Connections
- Double-click “Restrict Remote Desktop Services users to a single Remote Desktop Services session
- Check “Disabled” and apply.
There is one caveat, however. It seems to leave a Console session active at all times. You can log off the Console session via Task Manager. If you connect to it (by right-clicking it in task manager) it doesn’t seem to be doing anything.
To get the ASP error message and line number in code, do the following:
1. Go to Error pages
2. Under actions click Add
3. Enter status code 500.100
4. Select ‘Execute URL on this site’
5. Enter your error page, i.e. 500.asp
Now the Server.GetLastError object will contain the full error information.
By default ASP errors are not displayed on a Windows 2008, II7 server. The default error message displayed simply says:
500 – Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
This is for very good reason. Detailed error message can display sensitive information that you do not want public. But for development purposes we need to see the error message to properly resolve the error. Here are the steps to display the detailed error message.
In the IIS settings for the website:
1. Go to “ASP” (under IIS).
2. Set “Send Errors to Browser” to true.
If it still doesn’t display the detailed error follow these steps.
1. Go to “Configuration Editor” (under Management section).
2. Under system.webServer, select “httpErrors”.
3. Set errorMode to “Detailed”
Be sure to add proper error handling when taking the website live.
Today I used SSIS packages for the first time. SSIS packages are used by SQL Server Integration Services. There are a couple things I have found about SSIS packages that I want to write about.
I am using an SSIS package to copy data from an Access database to SQL Server. This SSIS package can be executed on a schedule, or from a web browser. I couldn’t figure out how to execute an SSIS package, so I found some excellent instructions on this blog.
- I believe you can only run SSIS packages on SQL Server 2005. SQL Server Integration Services doesn’t come with SQL Server Express.
- In order to run my SSIS package, I needed to have xp_cmdshell enabled in SQL Server Surface Area Configuration.
- I can execute the stored procedure from VB or CS code in ASP.Net, but it is more secure to hard-code the command line in a Stored Procedure and call that from the VB or CS code.
- The command line I use is:
Declare @SSISPackage varchar(50)
exec master..xp_cmdshell ‘dtexec /F “‘ + @SSISPackage + ‘”‘
- To run this stored procedure, the user must have access to the mssqlsystemresource database. Thus, as far as I know, you have to log in with the sa account. I use the sa account only on this one page that needs it. Everywhere else on this site cannot access the sa account. If you don’t have privileges, you will get this message:
The EXECUTE permission was denied on the object ‘xp_cmdshell’, database ‘mssqlsystemresource’, schema ‘sys’.
These are just my notes for SQL Server Integration Services. SSIS allows me to easily perform this import process very easily.
I had a file upload page that gave an HttpException with message “Request timed out”. Natrually, I set the Server.ScriptTimeout to 360. But I still got the error rmessage. To solve this I added the following to the web.config file:
The maxRequestLength did not solve the problem by itself. The executionTimeout was needed as well.
To switch Terminal Server between full screen and a window use CTRL + ALT + BREAK.
How to configure SQL Server 2005 to allow remote connections: http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277