Showing posts with label Visual Studio 2008. Show all posts
Showing posts with label Visual Studio 2008. Show all posts

Tuesday, September 30, 2008

WebTest brings down Visual Studio.

I started a WebTest that fires 200,000 requests to the web server. I left the test running overnight. On getting back to work today, I found that the Visual Studio instance running the test has crashed!! To my dismay, Visual Studio did not even generate a trx file, which would have given me some idea as to how many requests it was able to shoot and what might have caused it to crash.

This experience has made me wiser though. I have now kicked off the webtest using command line.

mstest /testcontainer:testproject2.dll /test:WebTest1Coded /runconfig:localtestrun.Testrunconfig /resultsfile:testResults.trx

The test has completed and I have a 639 MB trx file lying on my disk, which always brings down Visual Studio when I try to load it. So it is now as good as not having the file to analyze. Take this lesson from me (for free) - Do not try to run a WebTest that will generate a trx file of such a size that it cannot be opened later in VS for analysis. I could not find anything on msdn that tells me of the upper limit on size of trx file. Can we have that, Microsoft?

Instead of trying to find a fault with Microsoft, let me see what could have gone wrong in the code. The WebTest code was firing 200,000 requests in a for loop with each request getting a different aspx page. I think I should remove the for loop, parameterize the web page and create a load test based on this webtest. Let me check this. Will update this space in a few hours :)

Friday, September 26, 2008

.NET Runtime versions.

Aaron Stebner's blog has a table that lists all .NET versions released so far. This table is very useful if you are creating a Logical Data Center diagram in Visual Studio Team Architect and want to specify the 4 part version number of the Target Framework. Thanks Aaron! :)

Wednesday, February 6, 2008

Using VS 2008 Code Metrics tool for SharePoint projects.

I ran the Code Metrics tool on a VS 2008 project containing a set of SharePoint web parts. The tool failed to show code metrics for Projects that had a reference to Microsoft.SharePoint DLL. Given below is the message I received.

An error occurred while calculating code metrics for target file 'D:\MyFolder\Projects\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe' in project ConsoleApplication1. The following error was encountered while reading module 'Microsoft.SharePoint': Security attribute type does not have a default constructor: Microsoft.SharePoint.Security.SharePointPermissionAttribute, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, Publickeytoken=71e9bce111e9429c.

I found the same issue reported on Microsoft connect site, but it had been closed since Microsoft was unable to reproduce the issue. So I provided the steps to reproduce the issue and got back to my work.In the process, I created a dummy console application with a reference to Microsoft.SharePoint. After submitting the repro steps, I had a good look at the error message and thought: "What if I include a reference to the Microsoft.SharePoint.Security namespace? Will that help? Let me try..." I did that and ran the Code metric tool. Pronto, I had the code metrics for the SharePoint project in the Code Metric Results section!!! Doing something for the community somewhere down the line helps you, isn't it? :)

So if you run into a similar issue when using the Code Metrics tool, just add a reference to "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\Microsoft.SharePoint.Security.dll" and re-calculate the code metrics.

What is success?

The journey of life takes us through varied experiences like landing an admission at a prestigious college, earning a degree, getting hired,...