You are currently offline, waiting for your internet to reconnect

How to debug managed-client applications that are started by using a URL in Visual Studio .NET or in Visual Studio 2005

This article describes how to use the IEExec.exe application to debug managed-client applications that you start by using a URL in Microsoft Visual Studio .NET or in Microsoft Visual Studio 2005.

back to the top

Discuss the IEExec.exe application

The IEExec.exe application is an undocumented Microsoft .NET Framework application that is included with the .NET Framework. You can use the IEExec.exe application as a host to run other managed applications that you start by using a URL.

For example, when you start a smart client by using a URL, no processes run with the smart client name. Instead, each application that you start by using a URL receives its own copy of the IEExec.exe application. The IEEXEC.exe application sets up the appropriate environment for the application to run in.

Typically, the IEExec.exe application works closely with Microsoft Internet Explorer to help you start the .NET Framework applications. The IEExec.exe application hooks to Internet Explorer version 5.01 and later to listen for assemblies that are requested. During a request, the executable is downloaded to the assembly download cache. Internet Explorer spawns a process for the IEExec.exe application and then passes the raw evidence information of the executable to the IEExec.exe application. The IEExec.exe application then uses the raw evidence information to set up an environment that has constrained-security settings for the executable.

back to the top

Use the IEExec.exe application

The following table provides information about the features that you can use in the IEExec.exe application with the .NET Framework 1.0:

Usage: ieexec.exe url flags [zone] [uniqueid]
URL to the application to start. Example: http://localhost/sample.exe
flags parameter to control execution:
0:no flags
1: create evidence for the zone only
2: create evidence for the site only
3: create evidence for both the zone and the site
If the flags indicate zone, a zone must be provided. Values can be:
0: MyComputer
1: Intranet
2: Trusted
3: Internet
4: Untrusted
5: NoZone
Unique id for the site. If the flags indicate a site, a uniqueid must be provided. Otherwise, there will be unused hex-encoded bytes. You can just use 00.

Important How you use the IEExec.exe application that is included with the .NET Framework 1.1 is different from how you use the IEExec.exe application that is included with the .NET Framework 1.0. In the .NET Framework 1.1, the IEExec.exe application only accepts the url parameter. The IEExec.exe application does not permit you to specify the zone setting and the site setting. If you try to specify the zone setting and the site setting, you receive the following error message at runtime:


back to the top

Create a Console Application project

  1. Start Microsoft Visual Basic. NET or Microsoft Visual Basic 2005. Create a Console Application project.
  2. In the Name box, type Q822485.

    By default, the Module1.vb file is created.
  3. Replace the existing code in the Module1.vb file with the following code:
    Imports SystemImports System.Security.PolicyImports System.CollectionsImports System.IOModule Module1   Sub Main()      Dim myEvidence As Evidence      myEvidence = AppDomain.CurrentDomain.Evidence      Dim myEnumerator As IEnumerator = myEvidence.GetHostEnumerator()      Dim i As Integer = 0      Do While (myEnumerator.MoveNext())         Console.WriteLine("[{0}] {1}", i + 1, myEnumerator.Current)      Loop      Console.ReadLine()   End SubEnd Module
  4. On the Build menu, click Build Solution.
  5. To create a virtual directory so that you can debug the Q822485.exe executable, follow these steps:
    1. Click Start, and then click Run. In the Open box, type inetmgr.

      The Microsoft Internet Manager Service window appears.
    2. Expand the server name.

      Note In this step, server is a placeholder for the actual name of your server.
    3. Right-click Default Web Site.
    4. Point to New, and then click Virtual Directory.
    5. In the Virtual Directory Creation dialog box, type DebugTest in the Alias text box.
    6. In the Web Site Content Directory dialog box, click Browse, and then locate the folder where you created Q822485.exe in step 1.

      For example, the location of the folder may be C:\Inetpub\wwwroot\Q822485\bin.
    7. Click OK.
    8. In the Access Permissions dialog box, click Next.
    9. Click Finish.
back to the top

Configure Visual Studio .NET

You must configure Visual Studio .NET to debug the Console Application project. To debug the Console Application project, you must run the Console Application project in the IEExec.exe application. To do this, follow these steps:
  1. On the View menu, click Solution Explorer to open the Solution Explorer window.

    Alternatively, you can press Ctrl+Alt+L to open the Solution Explorer window.
  2. Right-click the project, and then click Properties to open the Q822485 Property Pages dialog box.
  3. In the left pane, click the Configuration Properties folder, and then click Debugging.
  4. In the right pane, click Start external program, and then set Start External program to IEExec.exe.

    Typically, the IEExec.exe application is located in one of the following folders:
    • C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\ieexec.exe
    • C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ieexec.exe
  5. Specify the parameter in Command Line Arguments for IEExec.exe.

    For example, you may specify the following parameter:
    http://localhost/DebugTest/Q822485.exe 3 1 00
    Note If you are using the IEExec.exe application that is included with the .NET Framework 1.1, you can only specify the following url parameter:

  6. Set a break in your application code.
  7. On the Debug menu, click Start to run the application.
back to the top
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
313892 HOW TO: Use the IEHost log to debug .NET object hosting in Internet Explorer
For additional information about code access security, visit the following Microsoft Developer Network (MSDN) Web site:
For additional information about security policy management, visit the following MSDN Web site:For additional information about the .NET Framework Configuration Tool (Mscorcfg.msc), visit the following MSDN Web site:back to the top

Article ID: 822485 - Last Review: 12/03/2007 18:48:35 - Revision: 2.6

Microsoft Visual Studio 2005 Professional Edition, Microsoft Visual Studio 2005 Standard Edition, Microsoft Visual Studio 2005 Express Edition, Microsoft Visual Studio .NET 2003 Professional Edition, Microsoft Visual Studio .NET 2003 Enterprise Architect, Microsoft Visual Studio .NET 2003 Enterprise Developer, Microsoft Visual Studio .NET 2002 Professional Edition, Microsoft Visual Studio .NET 2002 Enterprise Architect, Microsoft Visual Studio .NET 2002 Enterprise Developer, Microsoft .NET Framework 1.1, Microsoft .NET Framework 1.0, Microsoft .NET Framework 2.0

  • kbvs2005applies kbvs2005swept kbconsole kbdebug kbhowtomaster KB822485