PRB: No Option to Attach in Native Mode When the Native COM DLL Throws an Exception (822321)
The information in this article applies to:
- Microsoft ASP.NET (included with the .NET Framework 1.1)
SYMPTOMSWhen you call a Component Object Model (COM) DLL from
server-side Microsoft Active Server Pages (ASP) code, you may receive an
exception. The native code of the COM DLL throws this exception, and the Just-In-Time Debugging dialog box appears without an option to attach to the native mode.CAUSEThis behavior is by design because Microsoft Internet
Information Services (IIS) catches the native exception and then turns this
exception into a script error.WORKAROUNDTo work around this problem, manually attach the Dllhost.exe
process to the native mode. To work around this problem for the scenario that
is mentioned in the "More Information" section of this article, follow these
steps:
- In Microsoft Visual Studio .NET, open the Proj1 project.
Note Proj1 is the name of the project that is created in the "More
Information" section of this article. - In Windows Explorer, locate the DllStore folder that is created
in the "More Information" section of this article.
- Drag the Cal.cls file to Visual Studio .NET where the Proj1 project is open.
- In the Cal.cls file, set a breakpoint on the following
statement:
Function Divfunction(FirstNumber, SecondNumber) - On the Debug menu, click
Processes, and then select the Dllhost.exe
process that has the Title field as
Microsoft Active Server Pages.
Note If the DLLHOST.EXE process is not available in
the list of processes, click Start on the
Debug menu to stop debugging. - Click Attach.
- In the Attach to Process dialog box, click
to select the Native check box , and then click
OK.
- In the Processes dialog box, click
Close.
- Visit the ASP page with the following URL:
http://localhost/Proj1/Asp1.asp
Notice that debugging breaks at the breakpoint that you
have set in the Cal.cls file.
STATUS This
behavior is by design.REFERENCES For
additional information, click the following article numbers to view the
articles in the Microsoft Knowledge Base: 170946
HOWTO: Create and Use a Minimal ActiveX Component in VB
303845 HOWTO: Create or Open a Visual Studio .NET Project in the Root Web
Modification Type: | Major | Last Reviewed: | 10/17/2003 |
---|
Keywords: | kbCOMInterop kbDLL kbDebug kbprb KB822321 kbAudDeveloper |
---|
|