Microsoft KB Archive/822485

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

Article ID: 822485

Article Last Modified on 12/3/2007

-

APPLIES TO


 * 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

-





IN THIS TASK

 * SUMMARY
 * Discuss the IEExec.exe application
 * Use the IEExec.exe application
 * Create a Console Application project
 * Configure Visual Studio.NET
 * REFERENCES



SUMMARY
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:

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:

ArgumentException

back to the top

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(&quot;[{0}] {1}&quot;, 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  name.

Note In this step,  is a placeholder for the actual name of your server.</li> Right-click Default Web Site.</li> Point to New, and then click Virtual Directory.</li> In the Virtual Directory Creation dialog box, type DebugTest in the Alias text box.</li> 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.</li> Click OK.</li> In the Access Permissions dialog box, click Next.</li> Click Finish.</li></ol> </li></ol>

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: <ol> 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.</li> Right-click the project, and then click Properties to open the Q822485 Property Pages dialog box.</li> In the left pane, click the Configuration Properties folder, and then click Debugging.</li> 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: <ul> C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\ieexec.exe</li> C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ieexec.exe</li></ul> </li>  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 </li> Set a break in your application code.</li> <li>On the Debug menu, click Start to run the application.</li></ol>

back to the top

<div class="references_section">