Microsoft Knowledge Base Email Alertz

KBAlertz.com: (822485) - 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. back to the top Discuss the IEExec.exe application The IEExec.exe application is an...

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 822485 - Last Review: December 3, 2007 - Revision: 2.6

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

On This Page

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.

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:

ArgumentException

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 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
    
  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.

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:

    http://localhost/Q822485.exe
  6. Set a break in your application code.
  7. On the Debug menu, click Start to run the application.

REFERENCES

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:
http://msdn2.microsoft.com/en-us/library/930b76w0(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/930b76w0(vs.71).aspx)
For additional information about security policy management, visit the following MSDN Web site:
http://msdn2.microsoft.com/en-us/library/c1k0eed6(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/c1k0eed6(vs.71).aspx)
For additional information about the .NET Framework Configuration Tool (Mscorcfg.msc), visit the following MSDN Web site:
http://msdn2.microsoft.com/en-us/library/2bc0cxhc(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/2bc0cxhc(vs.71).aspx)

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
Keywords: 
kbvs2005applies kbvs2005swept kbconsole kbdebug kbhowtomaster KB822485
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please