Solved

Thread exception  Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack

Posted on 2011-02-17
6
1,214 Views
Last Modified: 2012-06-27
Im facing a problem- Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.
 Im working on Windows Application .net VS 2008.( im not using Response.Redirect). I got error when the code that is in thread is completed and call myThread.Abort() method. Any idea t solve the problem?
0
Comment
Question by:sigmatec_pk
  • 4
  • 2
6 Comments
 
LVL 10

Expert Comment

by:daryal
ID: 34924071
Hello,
are you using a third party tool or dll or unmanaged code (like c) somewhere?
If this is the case, then I think the problem can be related with the unmanaged code.
0
 
LVL 10

Expert Comment

by:daryal
ID: 34924081
Also, please note that your thread may be terminated before you call thread.abort.
0
 

Author Comment

by:sigmatec_pk
ID: 34924448
@daryal::
thanks for repy. No, im not using any third party dll or unmanaged code. I ve debugged code it executed fine, on thread Completion method when i abort the thread myThread.Abort it goes to catch block.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 10

Accepted Solution

by:
daryal earned 500 total points
ID: 34924486
why you are aborting the thread if the thread is complete?
0
 

Author Comment

by:sigmatec_pk
ID: 34940445
@daryal:

is it not necessary to abort the started thread?
0
 
LVL 10

Expert Comment

by:daryal
ID: 34942331
As far as I know, if the thread completes, there is no need to abort it.
In fact, aborting a thread is usable in a few cases and it is done on a purpose, not for every thread.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A short article about a problem I had getting the GPS LocationListener working.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now