Monday, January 16, 2012
Command-line Cyclomatic Complexity in VS2008 with VS2010 free Metrics.exe
Wednesday, May 13, 2009
Troubleshooting Visual Studio Profiler with ASP.Net
Visual Studio 2008 (and I think 2005) come with a built-in .Net profiler. Profilers are especially useful for troubleshooting performance bottlenecks (Related: CLR Profiler for old versions of Visual Studio; SQL Profiler). There are already good tutorials on it, so here I'm just offering misc tips and troubleshooting. Basically, you can go to Analyze > "Launch Performance Wizard", and just select all the defaults. You can use this with ASP.Net web projects too.
Error: When trying to start, I got "Value does not fall within the expected range".
Solution: You can set the config of a website to "Any CPU".
Error: VSP1351 : The monitor was unable to create one of its global objects
Other times I got this error:
Error VSP1351 : The monitor was unable to create one of its global objects (Local.vsperf.Admin). Verify that another monitor is not running, or that another application hasn't created an object of the same name.
Profiler exited
PRF0010: Launch Aborted - Unable to start vsperfmon.exe
Solution: You can use Process Explorer to see what is locking "vsperf.Admin", and then kill that process tree. For me, it was the aspnet_wp.exe process.
Error: PRF0010: Launch Aborted - Unable to start vsperfmon.exe
Sometimes I got this error:
PRF0010: Launch Aborted - Unable to start vsperfmon.exe
Error VSP1342 : Another instance of the Logger Engine is currently running.
Profiler exited
Solution: I restarted Visual Studio (yes, it's lame, but it appeared to work). I also ensured that all other instances of VS were closed.
Error: Sometimes clicking the stop button caused IE and VS to crash, without even collecting data
Solution: By just closing the IE browser directly, it worked.
Tuesday, March 24, 2009
R6034 - An application has made an attempt to load the C runtime library incorrectly
A coworker recently got this error when trying to open a web application project within Visual Studio 2008:
Runtime Error!
Program: C:\Prog...
R6034
An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information.
Note that in this case, (1) Visual Studio opened just fine, (2) the problem was in merely loading a web project, and (3) nothing was even being compiled yet.
It turned out the problem was likely from a corrupt uninstall of the .Net 3.5 SP1. By re-installing the SP, things began to work again.
NOTE: .Net 3.5 SP1 has a potential error with the web dlls, so you may need to make some tweaks to the GAC.