Results 1 to 3 of 3

Thread: Any tool or setting in VS that prevent/alert on cross thread operations?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Any tool or setting in VS that prevent/alert on cross thread operations?

    Hi!

    I am doing code review of some of my customers developers code, and found that two of them are producing code (VB.NET and C# windows forms) with a lot of potentially dangerous calls to the UI from worker threads. Usually the debugger will throw an exception, but I checked, and these guys have turned off all exceptions for System.Threading (because they got annoying errors when debugging, they told me when I asked them) and hence, this code was released to the customer.

    Now, I would love to find some setting or tool that will alert us if code like this is being checked in. Do you know of any tool or setting in VS 2012 that will react to these kinds of errors?

    I have just recently set up a Team City buildserver, so in the long run, some tool that would catch errors like this would be great, I simply do not have time to check every single commit by these guys.

    Any help is greatly appreciated.

    /Henrik

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,047

    Re: Any tool or setting in VS that prevent/alert on cross thread operations?

    I know of no such tool, but I'd have to say: Good luck.

    That's a rough situation you described. You are kind of relying on code written by people who want to ignore problems rather than fix them. That's just nasty.
    My usual boring signature: Nothing

  3. #3
    PowerPoster SJWhiteley's Avatar
    Join Date
    Feb 2009
    Location
    South of the Mason-Dixon Line
    Posts
    2,256

    Re: Any tool or setting in VS that prevent/alert on cross thread operations?

    This is a coding 'violation', so there should be a tool to detect such issues - I don't know if FxCop can detect the CheckForIllegalCrossThreadedCalls setting in code - It rips apart a lot of my code, though, for less 'criminal' coding...

    Microsoft FxCop uses the 'introspection' analysis engine. I do not know of any others or how to incorporate one, but it might be a start: if you can run your own analysis on the source, you could detect the unwanted coding. How to do that? I am not sure, but may be a point of research.
    "Ok, my response to that is pending a Google search" - Bucky Katt.
    "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
    "Before you can 'think outside the box' you need to understand where the box is."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width