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.
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.
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:
Collapse this tableExpand this table
| Usage: | ieexec.exe url flags [zone] [uniqueid] |
| Option: | |
url: | URL to the application to start. Example:
http://localhost/sample.exe |
flags: | 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 |
zone: | 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 |
uniqueid: | 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:
Create a Console Application project
- Start Microsoft Visual Basic. NET or Microsoft Visual Basic
2005. Create a Console Application project.
- In the Name box, type
Q822485.
By default, the Module1.vb file is
created. - Replace the existing code in the Module1.vb file with the
following code:
Imports System
Imports System.Security.Policy
Imports System.Collections
Imports System.IO
Module 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 Sub
End Module
- On the Build menu, click Build
Solution.
- To create a virtual directory so that you can debug the
Q822485.exe executable, follow these steps:
- Click Start, and then click
Run. In the Open box, type
inetmgr.
The Microsoft Internet Manager
Service window appears. - Expand the server
name.
Note In this step, server is a placeholder
for the actual name of your server. - Right-click Default Web Site.
- Point to New, and then click
Virtual Directory.
- In the Virtual Directory Creation
dialog box, type DebugTest in the Alias
text box.
- 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. - Click OK.
- In the Access Permissions dialog box,
click Next.
- Click Finish.
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:
- 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. - Right-click the project, and then click
Properties to open the Q822485 Property Pages
dialog box.
- In the left pane, click the Configuration
Properties folder, and then click
Debugging.
- 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
- 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:
http://localhost/Q822485.exe - Set a break in your application code.
- On the Debug menu, click
Start to run the application.
For additional information, click the following article
number to view the article in the Microsoft Knowledge Base:
313892Â
(http://kbalertz.com/Feedback.aspx?kbNumber=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: