WinDbg and Visual Studio Express editions - c#

Can WinDbg can be used together with the Visual C# 2008 Express Edition?

windbg isn't really an IDE debugger; it is more commonly used directly on compiled exes on the machine. As such, yes, it should be OK to use with an exe compiled with Express Edition, but no: there is no direct involvement of Express Edition in this.
Ultimately, the Express, Pro, Team etc products all use the same compiler that can be used at the command line (csc - although they might access it more directly than the exe!).
Look also at "SOS" (Son Of Strike)

Good question.
VS C# 2008 Express Edition contains a managed debugger.
You will most likely run into some issues running both Windbg and VS2008 Managed Debugger against the same process.
Things you may experience are breaks, and access violations within Windbg that are typically handled just fine without the presence of a native debugger.
As long as you don't intent to perform simultaneous native and managed debugging (with different debuggers) you can attach Windbg in non-invasive mode to a process that is running under a managed debugger without any issues.
Here is a link to some additional inforamtion on ICordbg
(Partition of ICorDebug)
Thanks,
Aaron

Related

Visual Studio 2010 Debugger

I'm having some problems (as some of you will see from another question I asked) with getting a program I made in Visual Studio 2010 to run on another computer.
My computer is Windows 7 x64
The destination computer is Windows XP x86 (SP2)
I've already checked to see that I'm compiling for x86.
Anyway, my question is: Is there a debugger I can install that will tell me what errors the program is having? Like a .NET Debugger that does not involve me installing Visual Studio 2010 on the destination computer?
If you have access to the client computer when it is running the program, the easiest thing would probably be to deploy the remote debugger, and debug the program on your own machine, while it is running on the client PC.
Otherwise, you can use DbgClr, which is distrubted with the .NET framework SDK.
One option is to use WinDbg + the SOS extension. This is a much lighter weight debugger that is easily installable but has a steeper learning curve than Visual Studio. I often use it though when I need a light weight debugging experience
WinDbg http://www.microsoft.com/whdc/devtools/debugging/installx86.Mspx
SOS: http://msdn.microsoft.com/en-us/library/bb190764.aspx
Another option is to use a program like ProcDump to take several snapshot dumps of your program on the remote computer and USB copy them to debug back at your workstation.
http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx
You can save a dump at various triggers like an Unhandled exception. Visual Studio can open the dump back at your workstation and 2010 supports mixed mode debugging.

visual studio 2010 debugger hanging

The debugger is hanging intermittently but frequently for no obvious reason. It times out eventually and recovers.
I am using vs 2010 Microsoft Visual Studio 2010 Professional 10.0.30319.1 RTMRel, running a 4.0 client app on a Vista 64 o/s.
Has anyone else been having this issue too, and have a fix?
As a related aside, anyone know if there are any service releases yet??
Cheers,
Berryl
Well, in 2005 and 2008 this happens all the time as well. Usually it has to do with (a) loading symbols from a public symbols server (yeah network I/O on the UI thread!), or (b) intellisense, or (c) you're debugging the network stack (or some other OS component) and Visual Studio is trying to use it (and things deadlock). If (b), wait for it to finish doing its thing before you start debugging. Sucks up front, but saves you time and frustration in the long run.
There are no service packs for Visual Studio 2010 yet. I've also had problems in the debugger, and sadly the best advice I can give that has worked for me is to exit Visual Studio and re-open it.

Visual Studio: Real time method call trace?

This is what I'm looking for: I'd like to be able to get a real time method call listing when I am debugging my program. So for example, say I run my program via the debugger if I press a button or do anything in my program I'd like for it to spit out, say on a visual studio plugin, in real time, all the methods it went through when I pressed this button or did some kind of user action with my program.
I actually once wrote a visual studio plugin that does that by using the visual studio profiler api (I had to write a c++ com server dll that receives this information and pipes it back into my c# plugin). I did this a few years back and I have no idea where I put it. But I'm wondering if Microsoft did something like this in visual studio 2010 or if you know of any third party plugins like this because it is a very handy debugging utility.
Thanks
Check out Visual Studio 2010's Intellitrace feature - it might get you what you need: http://msdn.microsoft.com/en-us/library/dd264915.aspx
You should check IntelliTrace debugging in Visual Studio 2010. It works only with x86 though
It's not free, it's not even cheap, but RedGate's ANTS Performance Profiler can provide that data and more.
I think you could achieve that using AOP, e.g. PostSharp and an implementation of it's OnMethodBoundaryAspect and a MultiCastAttribute to apply your aspect to every method of your program. They even have an example for something quite similar to what you want on their site.
Updated link as of 8/15/2018: IntelliTrace
Note that this feature is in Enterprise edition only
From the linked page:
You can spend less time debugging your application when you use
IntelliTrace to record and trace your code's execution history. You
can find bugs easily because IntelliTrace lets you:
Record specific events
Examine related code, data that appears in the Locals window during debugger events, and function call information
Debug errors that are hard to reproduce or that happen in deployment
You can use IntelliTrace in Visual Studio Enterprise edition (but not
the Professional or Community editions).
My Runtime Flow extension shows method call listing when you press a button or do anything in a program. It works outside Visual Studio debugger.

Analyzing a .Net application without VisualStudio

Is there a simple, free way to analyze .Net code (set breakpoint, see stack traces, see running threads) without Visual Studio? Note that I don't need to compile the code, just analyze how it works. I have both source code and binaries but I don't have a Visual Studio license. Unfortunately, the solution file gives several error when I try Visual Studio Express.
EDIT: I may be able to get most of the projects in the solution to load, but I don't see an option for "Debug|Attach to process". Is this not available in Visual Studio Express?
Have you tried SharpDevelop?
If I remember right, MonoDevelop is free, runs on Windows, and supports debugging. I'm not sure if this only works with some languages, but you can give it a go!
Edit: Just checked, and MonoDevelop supports debugging of managed code in its Windows version.
Windbg, allthough its probably too low level for you.
if you want to statically peek at it dont forget reflector http://www.red-gate.com/products/reflector/
the worlds best source browser - and it doesnt even need the source
You're probably missing some required DLLs, causing VS Express to give you an error.
Please post the exact error message(s).
Visual Studio Shell (Integrated Mode) allows you to attach to a process. This edition is basically:
Does not include any support for particular languages, but
Allows extensions to be installed to, for example, add support for a new language
Allows you to attach to a process using the managed or native code debugger

What is the downside to using the Visual Studio Express Editions?

I'm developing an application using Visual C# Express Edition - what is the downside to using the express editions? Are there any limitations on what I can build and release? Will my users be able to tell I'm using the Express Edition?
It won't impact your users, other than by making you less productive by prohibiting add-ons such as ReSharper, TestDriven.NET, etc. and not having some of the built-in features of the commercial editions.
To put it another way: if a word processor didn't have a spell checker, you could still make sure that your documents were spelled correctly, so readers wouldn't know - but it's a lot quicker (usually!) if the tool has it built in...
Here is a huge comparison chart of all versions of Visual Studio, from Express until Team System.
Visual Studio 2008 Product Comparison Guide
No AddIns whatsoever - no ReSharper, no TestDriven.net, no VisualSVN, no nothing
Server Explorer does not support remote databases
No support for solution folders
Express targets only a single Framework - Express 2008 targets .net 3.5 only. (Edit: I was wrong, Express 2008 indeed supports multi-targeting)
Reinstalling Express may require re-registration which is free, but can be shut down any time from Microsoft
Apart from that, it's fine. It uses the same compiler to generate the same code, you just don't get all the Time-Saving tools that VS Professional offers.
The Express debugger does not allow Attach to Process:
The ability to attach the debugger to
an already-running process has also
been removed, hindering scenarios such
as writing Windows services and
re-attaching a debugger under ASP.NET
when errors under the original
debugging session cause breakpoints to
be ignored.
I can live with everything else but that.
Only one language is supported. You can't have an application in C# and a library in C++ in the same solution, for instance.
Also, third party ADO.NET providers are not supported in the designers
See features and tools available with Express editions, Visual Studio Standard and Professional editions, and Visual Studio Tools for Office.
It has no mobile device support - one of the most important features, for me :o)
No MFC visual gui builder for C++.
EDIT
Oops - just read the C# tag. I'll leave this up though in case it comes up in a search for anyone else who might also be using c++
Visual Studio Express can do "most" of what the higher editions can do until you start getting into more advanced things such as trying to install third-party components and get full integration, adding database projects, integration into third-party systems, etc. On that note even Visual Studio Standard lacks several of these features so you'd be looking at Professional (at a minimum) to get a fully robust and feature-rich edition.
The current version of VS Express (I'm writing in 2014) has no diagnostics. No assert method and things like stat monitoring. For me this means I'll use a different version to finish a site because it limits testing and validation. No point in making a sub-par .NET site to be actually used.

Categories