Home | Contact Us | Download | Support | Purchase | Products


Product List
 
  "After about 3-4 days of struggling with this [SMTP] issue, trying all the possible configuration change that we can think of, and after checking with Microsoft, IMail, and an Exchange server MVP, your solution was actually the one that made it work. Thank you! "
Alex Chang
Bibles for America
 
More
Testimonies

Using aspNetTraceRoute with Visual Studio .NET

When you are using aspNetTraceRoute in Visual Studio .NET it is recommended you IMPORT the aspNetDns.dll to the project. Once inside of the project, then set a reference to the IMPORTED copy, not the GAC installed copy. We recommend this method, because in the case aspNetDns is uninstalled from the server, your application will still run off of the imported aspNetDns.dll copy.

Please note that licensing requires a purchased license from aspNetDns for each copy installed on a different server or computer. The option of a site license is also available, where aspNetDns can be installed on an unlimited number of systems, at a single, physical location. Please visit www.aspNetTraceRoute.com for the latest licensing terms.

 

Using aspNetTraceRoute

aspNetTraceRoute is built on top of the System.Net.Sockets namespace.  To successfully build the ICMP packets, required by aspNetTraceRoute, raw sockets must be used. However, access to raw sockets can only be used by administrators. See the following kb article for more information.

PRB: RAW Socket Access Denied to Non-Admin Windows NT 4.0 and Windows 2000 Users

 

Using aspNetTraceRoute from an ASP.NET Page

This becomes an issue when you need to trace from an ASP.NET page.  From a default ASP.NET installation, you will need to make two changes to successfully trace from an ASP.NET page.  You will first need to allow the ASPNET account to act as part of the system. Once that is accomplished, you will be able to impersonate an administrator account to successfully trace.

 

Change 1

The first error encountered is typically--

An attempt was made to access a socket in a way forbidden by its access permissions
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.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions  message that says:

 

To fix this, you will need to

Open Control Panel | Administrative Tools | Local Security Policy, select  Local Policies and then User Rights Assignment from the tree "Act as part of OS" should be the second entry on the right hand paneontrol Panel. Add the ASPNET account to this list.

 

Change 2

The next change is a web.config entry that allows you to actually impersonate an administrator. To do this, open up the web.config in a text editor. Locate the <system.web> tag and add the following <identity> tag immedately afterwards.

<identity impersonate="true" userName="computername\AnAdministratorAccountHere" password="ThePasswordHere"/>

 

That's it!  That's all there is to allow aspNetTraceRoute to use the Raw sockets required to ping from an ASP.NET page.

 

More Information about Impersonation

MSDN: ASP.NET Impersonation
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaspnetimpersonation.asp

INFO: Implementing Impersonation in an ASP.NET Application
http://support.microsoft.com/default.aspx?scid=kb;en-us;306158


HOW TO: Use the ASP.NET Utility to Encrypt Credentials and Session State Connection Strings
http://support.microsoft.com/default.aspx?scid=kb;en-us;329290#3

 

Related Topics

Using aspNetTraceRoute in VS.NET [C#]

Using aspNetTraceRoute in VS.NET [VB.NET]

Using aspNetTraceRoute in a non-VS.NET Environment



The box is not shipped. aspNetTraceRoute is a downloadable product.