Friday, March 16, 2012

VS2005 can also access .Net 3.5 libraries

 

Last week, one of SDKs built with VS2005 threw an exception from client’s hosting apps on their machines. Finally we found the reason – we call GC.WaitForFullGCComplete in our app, though the function was introduced in .Net 3.5, while since 2.0/3.5 share the same mscorlib.dll in the Framework 2.0’s dir, which is also updated by .Net 3.5 after VS2008 is installed. Then VS2005 can use the new functions without problem. Developers did not notice it. Then, if the client’s apps do not install .Net 3.5, the problem happens. So, we need to tell clients to install the 3.5 framework with latest service pack in the future.

This is kind of interesting, and the reason why we distributed the SDK built with VS2005 is that some of our clients have not upgraded to VS2008, and can not open our SDK’s samples if we only distribute VS2008 solutions and samples.

Friday, March 2, 2012

Why debugging in my visual studio 2008 is too slow?

 

Recently, I just realized that my visual studio 2008 is extremely slow during debugging one of our mixed-code products, a single step over will take a few seconds! What happens? The same product works well on my colleagues’ machine.

And today, one of my colleagues told me debugging on his machine also got slow down recently for another c# project. I checked his debugging setting, disable some options, and his problem disappeared.

Then, I tried them on my machine, a little improved, but still quite slow. After profiling the visual studio during debugging, finally found it tries to search some missing source code for each debugging command. Since I copied symbols for some 3rd party components sometime ago for troubleshooting one of the component bug, and leave them there. Then, when visual studio starts debugging, it will try to locate those missing source files for each debugging command, Why? Once fails, it should stop searching during the session until I manually start the search.

Then, I made a copy for those symbols of 3rd components until later they are needed, now, my studio works quite well.