When using the ASP.NET 2.0 Menu control I was surprised to find that it did not support an image mouseover event to swap images. After doing a Google search and finding the post by Stephen Page at http://www.velocityreviews.com/forums/t117199-menu-control-aspnet-20.html I was able to use his example and develop the following code to implement the functionality. I added the custom attributes of ImageUrl and AltImageUrl to the sitemap file and then used the following ItemDataBound event on the menu control.
protected void _siteMenu_ItemDataBound(object sender, System.Web.UI.WebControls.MenuEventArgs e)
{
// Reference the underlying SiteMapNode object...
MenuItem item = (MenuItem)e.Item;
SiteMapNode nodeFromSiteMap = (SiteMapNode)e.Item.DataItem;
string onImage = "";
string offImage = "";
string navUrl = "";
// If we have an imageUrl value, assign it to the menu node's ImageUrl property
if (nodeFromSiteMap["imageUrl"] != null)
{
onImage = System.Web.HttpContext.Current.Request.ApplicationPath + System.IO.Path.Combine("/Images/Elements/", nodeFromSiteMap["imageUrl"]);
offImage = System.Web.HttpContext.Current.Request.ApplicationPath + System.IO.Path.Combine("/Images/Elements/", nodeFromSiteMap["altImageUrl"]);
}
navUrl = nodeFromSiteMap["url"];
// These objects are necessary in order to capture the image object into a rendered html format
string src = offImage;
string toolTip = "";
System.Text.StringBuilder sb = new System.Text.StringBuilder();
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter htmWriter = new HtmlTextWriter(sw);
HtmlImage image = new HtmlImage();
image.Style.Add("border-style", "none");
MenuItem theMenuButton = new MenuItem();
theMenuButton.NavigateUrl = navUrl;
image.Src = src;
if (onImage != "" && onImage != null)
image.Attributes["onMouseOver"] = "this.src='" + onImage + "';";
if (onImage != "" && onImage != null)
image.Attributes["onMouseDown"] = "this.src='" + onImage + "';";
image.Attributes["onMouseOut"] = "this.src='" + offImage + "';";
image.RenderControl(htmWriter);
item.Text = sw.ToString();
}
If anyone else has other options I would be glad to hear back from you.
The issue I previously identified below was due to the configuration not being set with a from email address and no SMTP server. After changing the setting for "emailNotificationFromAddress" in the web.config file in the Microsoft Visual Studio 2005 Team Foundation Server\Web Services\Services directory the system error is no longer occurring.
TF53010: An unexpected condition has occurred in a Team Foundation component. The information contained here should be made available to your site administrative staff.
Technical Information (for the administrative staff):
Date (UTC): 4/26/2006 6:41:46 PM
Application Domain: /LM/W3SVC/2/Root/services-1-127905504900665097
Assembly: Microsoft.TeamFoundation.Server, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a; v2.0.50727
Process Details:
Process Name: w3wp
Process Id: 2336
Thread Id: 7020
Detailed Message: Unrecognized default notification 'From' address:
We have started our move to Team Foundation Server. I was optimistic that all of the issues I had trying to implement the beta and CTP versions were a thing of the past. The end result had both some good and bad results.
The first thing I found out about the deployment was that due to the requirements of the configuration of SQL 2005 (such as that Team Foundation recommends we that the installation is Windows authenticaion only, and that replication is turned off) made me choose to install Team Foundation Server in its own SQL instance instead of trying to share the SQL instance for other applications. This led me to a single server deployment decision for the time being.
The data tier, SharePoint, and SQL Server installations went through without a hitch. I was starting to think that I would have no issues. But, then of course I ran into an error that had me baffled for quite a while. The error was :
Microsoft Visual Studio 2005 Team Foundation Server - ENU: ***ERRORLOG EVENT*** : ERROR:Error 28925.TFServerStatusValidator: Calling the Team Foundation Server ServerStatus Web service failed. Additional details about the problem can be found in the setup log. Verify your network configuration. For more information on troubleshooting this error, see the Microsoft Help and Support Center.
I noticed that the Team System web site was stopped so I went into the IIS Console and tried to start it and continue with the installation. It kept giving an error that the application was application was busy so the site would not start. I though it was something incorrect with the installation, but finally found that by shutting down all of the other services on the server, that there must have been another application using the 8080 port that the Team Foundation Server uses. After shutting down all of the other services (which included Windows Update Services, SMS, Cruise Control.NET) the installation completed recovering from the error that it has seen. I was pretty happy about that.
The strange thing is that after the installation completed I was able to turn back on all of the services and they are all running as expected.
The remaining issues I have are:
1) I periodically get an error in the Application Event Log:
TF53010: An unexpected condition has occurred in a Team Foundation component. The information contained here should be made available to your site administrative staff.
Technical Information (for the administrative staff):
Date (UTC): 4/26/2006 6:41:46 PM
Application Domain: /LM/W3SVC/2/Root/services-1-127905504900665097
Assembly: Microsoft.TeamFoundation.Server, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a; v2.0.50727
Process Details:
Process Name: w3wp
Process Id: 2336
Thread Id: 7020
Detailed Message: Unrecognized default notification 'From' address:
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Which could be related to me not setting up SMTP when doing the install and
1) The following error in the security log:
Object Open:
Object Server: SC Manager
Object Type: SC_MANAGER OBJECT
Object Name: ServicesActive
Handle ID: -
Operation ID: {0,474251345}
Process ID: 652
Image File Name: C:\WINDOWS\system32\services.exe
Primary Logon ID: (0x0,0x3E7)
Client Logon ID: (0x0,0x734D4A0)
Accesses: READ_CONTROL
Connect to service controller
Enumerate services
Query service database lock state
Privileges: -
Restricted Sid Count: 0
Access Mask: 0x20015
If anyone has any suggestions to resolve these I would be glad to hear from you.
After learning about the concept of continuous integration, I became interested in building a continuous integration environment that could not only build and deploy our projects, but could also connect to some type of visual indicator for project status. The following are the tasks we completed.
Create a Build Environment
We looked at a few options to automate our builds and decided to first try out CruiseControl.NET. CruiseControl.NET provide a pretty good platform to control the builds of projects based on schedule or code changes as well as a web site to view build information and force builds. While implementing the build process, we found that Cruise Control alone didn't provide all of the functionality required to build and deploy applications. This led us to add NANT into the process. NANT provides a much more flexible platform to perform the actual tasks of building and deploying the application, leaving Cruise Control to do the scheduling and reporting. NANT is also used to run our NUnit and FxCop tasks, as well as deploy the files to a QA server and execute the SQL scripts to apply the database changes to the QA database server.
Integrating the Ambient Orb
Once the build environment was up and running I decided to look for a devide to use as an indicator for build status. From a google search, I found a blog by Michael Swanson that talked about using the Ambient Orb for with a continuous integration environment. It seemed like great idea. After doing some research on the Orb, I wasn't very keen on the idea of paying Anbient to control the orb color by using their custom calls but instead decided to buy the availble serial interface for the Orb and develop something myself to control the color of the orb.
From there, the following are the steps I completed to get my Orb to display the status of our builds ( a general status since I didn't want to get an Orb per project).
1) I created an assembly that performed like a controller/driver to the orb, allowing me to make simple calls to the orb to change the orb colors in a number of ways. It allowed me to pass serial port number, red/blue/green color indicators, color by name or enum and other methods to easily control the orb display.
2) Since I didn't want to have the Orb connected to the build server, I then created a web service that could be called remotely on the machine connected to the Orb. This web service allowed me to call it giving the port, color, red/green/blue levels to control the orb.
3) Next, in trying to have NANT control the color of the Orb, I found it was easier to call a web page to pass the red/green color to indicate a successful or failed build than to call the web service. Therefore, I added aweb page as part of the web service project to control the color from after the build was completed.
4) Finally, in an attempt to use my single orb to indicate the general health of our builds consisting of a number of projects I decided to develop a windows service on the Orb machine that would look at each post from the build server, and keep track of the last build status for each project. If any of the builds last build failed, the orb would be red, if all builds last build was successful, then the orb would remain green.
What Next?
I am looking into other devices that could be used not only to display build information in a more detailed format, but possibly integrate other information such as tests passed/failed, code coverage, or other possible project information. If anybody has other suggestions it would be great to hear them.
I am also working on integrating MSBuild and Microsoft Unit Testing for Visual Studio 2005 into our build process.