Sunday, October 17, 2004

<ProcessModel>

Many a times asp.net code fails with or without an error but if the same is tried manually, it works!

Example:
  • Open Browser and type a URL; you are able to visit the site but when you try to do the same in ASP.NET using webrequest.create method, it fails with an error The underlying connection was closed: Unable to connect to the remote server.
  • Run a batch file that utilizes network resources; the batch file executes successfully but when you try to do the same in ASP.NET using process.start method, it fails without any error
Wonder why?

The reason is ASP.NET by default runs under the context of ASPNET user, change the <processmodel> tag and specify a user who is authorized to access the web server as well as network/domain resources and your code will work.

No comments: