views:

536

answers:

3

I've been trying, and failing, to get VS.NET 2008 to profile an ASP.NET MVC application. When I try and start a profiling session I get a generic server 500 error from VS.NET:

The web site could not be configured correctly; getting ASP.NET process information failed. Requesting 'http://localhost:4750/foo/VSEnterpriseHelper.axd' returned an error: The remote server returned an error: (500) Internal Server Error.

I've tried several things, including:

A brand new ASP.NET MVC app (i.e. File | New | Project ) will profile without problem, so I know my machine is capable of profiling such an app.

So, my question here is what are the other common and uncommon things that can prevent VS.NET from starting a profiling session on an ASP.NET app?

+1  A: 

Not sure if you've seen this: http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/8366799f-7bfd-4c80-a5f1-11a57ecfd966/

but it appears to be reporting the same issue you have and there is a response from the MSFT developer who wrote the Profiler tool:)

Steve Haigh
Thanks. This looks like it might be useful.
Martin Peck
+1  A: 

If you can't get VS.Net profiling to work there are a couple of 3rd party tools that might help. Obviously youy'll need to pay for these though.

ANTS has a free demo here: http://www.red-gate.com/products/ants%5Fmemory%5Fprofiler/index%5Fv2.htm

JetBrains also have a trace tool that offers profiling (I have not used this but I like their Resharper tool, so I suspect this will be good): http://www.jetbrains.com/profiler/index.html

Steve Haigh
ANTS worked first time and has already given me some excellent results. Thanks deadbeef.
Martin Peck
+2  A: 

In between wrestling with profilers, you can easily get a pretty good picture of what your program is doing from a time perspective by this method. What it reveals is usually a surprise.

Added: I do a fair amount of tuning, and I have a different perspective on these things, such as: wall-clock time is all that matters, individual instructions are more important than functions/methods, call trees & graphs are interesting but nobody knows what they really mean in terms of performance, the demos are all stilted toys like Mandelbrot, and individual samples are where the money's at, not summaries.

For example, tuning a .NET app, it takes a long time starting up. So in that interval, I sample it several times and ask "What is it doing and why?" It is looking up strings by ID in resources (so the strings can be internationalized). Is it necessary? If I look at the particular strings, they are ones that never need to be internationalized. No profiler can tell me this, but samples find it immediately.

Mike Dunlavey
Nice answer. You're right about asumptions - ANTS has pointed out several methods that I didn't think would ever be problematic.
Martin Peck
@Martin: Thanks. I added more explanation of what I mean.
Mike Dunlavey