ASP.NET Tips and Tricks

April 6, 2006 12:08 by admin

I hope those of you who came to the .NET User Group meeting yesterday enjoyed my session on Cool ASP.NET Tips and Tricks.

As promised the slides and demos can be downloaded from Scott Guthrie’s post or you can directly download the file.


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

IIS Lockdown & .NET

April 10, 2004 08:31 by admin

I recently ran into quite a few problems when the IIS Lockdown tool was applied on one of our production servers. I'm listing it here so that I don't trip over it again and also end up helping anyone who comes across the same problem.

My scenario is that we have a classic asp application relying on .NET components which use MSMQ. After applying the lock down tool the asp application worked fine until it called one of the .NET components that sent a message through MSMQ which threw this exeception:

Cannot execute a program. The command being executed was "c:\winnt\microsoft.net\framework\v1.1.4322\csc.exe". 

What I found out was that the XmlSerializer which was used by System.Messaging to send the message created a dynamic class and compiles it on the fly. The problem is that the lockdown tool denies access to all the .exe files in the Windows system folder (and subfolders). This prevents the csc.exe or vbc.exe which is in C:\WINNT\Microsoft.NET\Framework\v1.1.4322 from being able to dynamically compile. To fix this I gave the Web Applications group Execute permissions for this file but this threw another exception.

File or assembly name sk-fuua9.dll, or one of its dependencies, was not found. at System.Reflection.Assembly.nLoad(AssemblyName fileName...

After spending a couple of hours trying to figure this out, I finally got around to using the excellent FileMon tool which highlighted that the cvtres.exe too was used by csc.exe when attempting to compile. So I ended up giving Execute permissions for the cvtres.exe file for the Web Applications group and wallah problem solved!

The Microsoft KB recommends creating an seperate user and impersonating it in the application. But I feel that going this route makes it more secure since the default groups created by the lock down tool revokes most of the rights, which is not the case when you create your own user.


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Free Book on ASP.NET

October 8, 2003 23:13 by admin

Charles Carrol of LearnASP has released a free book on ASP.NET. This is a really good starting place for anyone learning the ropes.

I can remember when I frequently visited LearnASP.com for the quick tutorials when I first started working on ASP at Lanka Online in '99.


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

ASP.NET 2.0 Will Create History

October 2, 2003 22:50 by admin

I have a feeling that ASP .NET 2.0 is going to be truly revolutionary. Just take a look at the table of contents for this book.

Microsoft will be releasing an Alpha version this month at their PDC conference.

Just imagine:

  • DataGrids without any code for sorting, paging.
  • Project-less development in VS.NET
  • Visual Inheritance in ASP.NET
  • Pre-compilation of applications
  • Code-Free Data Binding
  • The GridView Control
  • Master Pages and Site Navigation
  • Security Server Controls
  • Password Recovery Control
  • Role Manager

The list goes on... I can't wait to get my hands on this stuff!


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Creating a Virtual Directory

August 19, 2003 22:58 by admin

I always wondered what the differences were between creating virtual directory using the IIS and through Windows Explorer (Web Sharing).

I found out today after spending over an hour trying to figure out why I was getting this error when calling my web service from a windows client: WebException: The request failed with HTTP status 401: Unauthorized

The reason is that when you create a Virtual Directory through IIS the default permission for the directory is Anonymous but when using Windows Explorer the default permission is set to Integrated Window Authentication.


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

ASP.NET StackOverflowException

July 24, 2003 21:00 by admin

What do you do when ASP.NET throws an exception like this?

Exception of type System.StackOverflowException was thrown.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.StackOverflowException: Exception of type System.StackOverflowException was thrown.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[StackOverflowException: Exception of type System.StackOverflowException was thrown.]


Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5