Tuesday, February 19, 2008

The SAK source control strings in Visual Studio's project files

If you opened up with notepad a project file used by VisualStudio you may have noticed 4 strings used for source control integration that have all "SAK" values.

It's pretty much up to the project to persist these 4 values any way the project likes.

In C# or VB project files these strings appear in the PropertyGroup section of the project:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>


Similarly, in a VC project the strings appear as attributes on the VisualStudioProject xml node

<VisualStudioProject ....
SccProjectName="SAK"
SccAuxPath="SAK"
SccLocalPath="SAK"
SccProvider="SAK" .... />


Or in a Setup project files the strings appear as follow:

"DeployProject"
{
"SccProjectName" = "8:SAK"
"SccLocalPath" = "8:SAK"
"SccAuxPath" = "8:SAK"
"SccProvider" = "8:SAK"
....
}



So, what are these strings and what is their meaning?

The 4 strings are used to store the source control bindings of a project. The source control integration and the project exchange these strings using SetSccLocation and RegisterSccProject function calls, and the projects persist the 4 values in settings with names resembling the function arguments (lpszSccProjectName, lpszSccLocalPath, lpszSccAuxPath, lpszSccProvider)

VisualStudio 2003 and older supported only MSSCCI source control providers for scc integration. In MSSCCI, the IDE (VS) needs to persist 3 connection strings (the strings are required for the SccOpenProject calls). The connection strings are provider-dependent, and VS stores these 3 strings plus a 4th one (identifying the provider) in the solution and project files. However, storing the real bindings in the project files makes life harder for developers if the projects are moved either in source control or on local disk, or if the projects are branched, etc. To reduce these problems, VisualStudio tries to take advantage of the settings persisted by the source control provider in the mssccprj.scc files (when possible), and stores in the project files just a flag that tells the scc integration package that the project is under source control. The real bindings are persisted by the scc provider (in the mssccprj.scc files) and VS reads them from there and uses them when needed.

And there you have it: when all 4 source control connection strings in a project have "SAK" values, this is just a flag that tells VS that the real source control bindings of that project are persisted by the MSSCCI scc provider (not by Visual Studio) and should be read from the mssccprj.scc file written by the scc provider in the same folder as the project file.

To my knowledge, the "SAK" strings are the initials of Sumedh A. Kanetkar who worked for source control integration back in 2000 (could it be a coincidence?), but that's not very important. The strings could have been any distinct values that could be recognized later and used as a flag (except empty values - empty string values are understood by projects as "the project is no longer under source control" in the call to SetSccLocation).

Recently, I've seen another interesting interpretation of these values for Team Foundation Server provider. In this forum post Richard says "SAK" stands for "Should Already Know", because TFS should be able to determine the source control bindings implicitly.
This is more or less true for TFS.

Technically, TFS has enlistment/workspace management functionality, and this information is stored on the TFS server, not on the client. Thus, TFS is always able to calculate the source control bindings of a project, so it's true, TFS provider "should already know" the scc bindings of a project just based on the location of the project file on disk, and it doesn't need to persist real bindings in the project files.
TFS scc provider in VS2005 and later is a VSIP source control provider, that has full control over what information is written in the solution and project files. TFS could have used and passed any other string values to the project systems to be persisted in the project files.

To work with VS 2003, TFS also implements a MSSCCI provider that creates mssccprj.scc files (so when a project is added to TFS in VS2003 the scc bindings are usually written having SAK-values with their MSSCCI sense). To make easier the migration path (when such VS2003 project is opened in VS2005) it makes sense to me that TFS would re-use the same SAK strings for TFS VSIP provider. I suspect this is one of the reasons TFS source control provider in VS2005 and VS2008 also writes SAK values for the 4 binding strings.

Tuesday, January 8, 2008

Yahoo mail error -2146823279 gExtContent is undefined

In the last couple of weeks I got error messages every time I tried to login to Yahoo! Mail.


Yahoo! Mail experienced a login error:
name:TypeError
message:'gExtContent' is undefined
number:-2146823279
description:'gExtContent' is undefined

Yahoo! Mail experienced a login error:
name:TypeError
message:Object required
number:-2146827864
description:Object required

Yahoo mail error -2146823279 gExtContent is undefined


However, if I clicked "Try again" in the next page, I could access my mail without problem.

Final page, click Try Again


For a while I just ignored these errors, but today they bothered me enough to make me try fixing the problem.

I searched the error message on Internet and I found two recommended solutions:
- clear up the browser history, temporary file cache, cookies, etc., and try again
- switch temporarily to Yahoo Mail Classic (there is link in top of page), then switch back to the new style

While these solutions have worked in the past for me for similar Yahoo errors, today they had no effect.

However, when I read more carefully the last error page, I realized it was talking about a program modifying the html page and about firewall settings blocking ads.

It then hit me I was running an Internet Explorer add-on program, IE7 Pro 2.0 that I use for blocking image-ads and Flash-based ads.

Ad blocking in IE7 Pro can be easily disabled from the context menu (not from firewall settings).

Disable ad blocking in IE7 Pro
As soon as I disabled ad blocking, Yahoo! Mail page opened without problem.

For a permanent solution, I enabled back ad blocking in IE7 Pro, accessed the Yahoo Mail account (got again the errors), and when I got the "Click here to try again" page, I used IE7Pro context menu to select "Ad Blocker / Don't filter this site".

Tuesday, December 11, 2007

Visual SourceSafe 2005 Update is available

Today Microsoft released the GDR/Update build (kind of ServicePack 1) for SourceSafe 2005.

The update targets improving the compatibility with VisualStudio 2008, Windows Vista and fixes a couple of bugs affecting performance, stability and reliability (most important, IMHO), plus a few customer annoyances.

You can download the update from this Visual SourceSafe 2005 Update MSDN page. If you're running Visual SourceSafe 2005, it is strongly recommended to upgrade your build.

Richard Berg maintains in his blog a more detailed list of the bugs fixed.

Sunday, October 14, 2007

Fixing the red menu_HelpPopup_reportertoolmenu error in Netscape Navigator

A friend told me today his Netscape Navigator is screwed. The main window showed in the bottom a red error message <menuitem id="menu_HelpPopup_reportertoolmenu"

menu_HelpPopup_reportertoolmenu

I was about to tell him to disable his Navigator Add-Ons, when Netscape downloaded and upgraded my Navigator from build 9.0b3 to 9.0rc1, and I started seeing the same problem.

I searched a bit the net and found out the menu_HelpPopUp_reportertoolmenu is related to a Reporter add-on that ships with SeaMonkey (who came up with this name anyway?!). The Website Reporter Tool [Help-->Report Broken Web Site] that is used by Netscape and Firefox does not select correctly its language sometimes and cause this error to appear.

There were a couple of solutions proposed:
- delete a file chrome.cdf in your profile (more info)
- switch to another language and back (more info)
- uninstall the extension (more info) either by manually messing with the same chrome.cdf or using Chrome Manager

None of the proposed solutions worked for me (I don't have a chrome.cdf file in my profile or at least I didn't find it, I have no idea how to switch languages or at least what I've tried had no effect, I had no add-ons installed for Netscape that I could uninstall, and the Chrome Manager part of Mnenhy installed but was hanging up on opening the manager window).

What worked eventually for me was:
- Close Netscape Navigator
- Go to C:\Program Files\Netscape\Navigator 9\chrome folder (or the Chrome subfolder of your Navigator install folder)
- Locate 2 files reporter.jar and Reporter.manifest and delete them
- Restart Netscape Navigator and the red <menuitem id="menu_HelpPoppp_reportertoolmenu" error message should be now gone.

Saturday, October 6, 2007

"Service CyberLink Background Capture Service (CBCS) hung on starting" and slow Vista logon on HP tx1000

A couple of days ago I bought a HP tx1000 laptop, and I noticed something weird: everytime I was logging on to Vista the screen become black, and the computer appeared to do nothing for a very long period of time; eventually the desktop appeared and things got back to normal.

I knew something was wrong and I was planning to run eventually some monitoring software to track this down. Fortunately, it was not necessary: Vista came to rescue. When I woke today the laptop from sleep the "Problem Reports and Solutions" dialog popped up, asking to send Microsoft a "Service hung report" for a "ClCapSvc" program. I had 7 of these reports to send, so I set to investigate further.

Service CyberLink Background Capture Service (CBCS) hung on starting

I looked in EventViewer, and the error there was reported as:
"The CyberLink Background Capture Service (CBCS) service is marked as an interactive service. However, the system is configured to not allow interactive services. This service may not function properly."

The service was registered in Services as:
    CyberLink Background Capture Service (CBCS)
Provides background buffering, recording and burning functionality for CyberLink Capturing
"C:\Program Files\HP\QuickPlay\Kernel\TV\CLCapSvc.exe"


I also noticed another related service, that was failing, too:
    CyberLink Task Scheduler (CTS)
Enables a user to configure and schedule a automated task for CyberLink Scheduling
"C:\Program Files\HP\QuickPlay\Kernel\TV\CLSched.exe"


So, the mystery was solved.
For me the service was installed as part of HP QuickPlay application, and it's used most likely for recording TV shows (and the other service for scheduling TV shows to be recorded as specific times). It's unclear to me why these services were intalled and automatically started, as I don't even have a TV tuner card!

It looks like the service comes with other software like Cyberlink PowerCinema, that was probably licensed by HP and repackaged into QuickPlay. Other users had similar problems... http://www.vistax64.com/vista-hardware-devices/78245-cyberlink-background-capture-service.html.

Solution 1: Disable the service. In Start menu, type and run Computer Management, select the Services node in the tree, and in the right pane select "CyberLink Background Capture Service (CBCS)". Right click the service, use Properties dialog to set the service to Disabled (Setting to Manual doesn't help, as during the boot some other crappy application will attempt to use the service causing it to start again). Ok the Properties dialog and repeat the procedure for the second service, CyberLink Task Scheduler (CTS).

Solution 2: The version of the CLCapSvc.exe file on my machine was 5.0.2510, and it was part of Hp QuickPlay 3.2. HP offers on its website an updated version of the program, HP QuickPlay Web Update 3.20A. Uninstalling the old version and installing the new one upgraded the file to version 5.0.2819, which doesn't seem to hangup on boot.

Since I don't need TV capture, I choose to apply both solutions...

Friday, September 28, 2007

Translation engines

Microsoft has recently released an update to its search engine. Aside from the advertised improvements I was pleased to discover the addition of a translator tool as an alternative to Google Translate; it also has a URL that for me seems easier to remeber.

I've played a bit with French-English translation and to me the Live Translator seems better than Google's version.
For other languages, Google wins (e.g. try translating with both engines from Chinese "用部落格分享照片、影音、趣味小工具和最愛清單,盡情秀出你自己" describing Windows Live Spaces :-))

The translation of a webpage is really interesting. I like the side-by-side comparison, with phrase hightlighting. See for instance the translation of CNN's home page.



For me it's not going to be an immediate bye-bye Google, but from now on I'll check both engines when I'll need a translation...

Try it out for yourself at http://translator.live.com

Tuesday, September 25, 2007

Implementing custom source control glyphs for VSIP scc providers

It's the second time in the last month when someone asked me how to implement correctly the IVsSccGlyphs.GetCustomGlyphList function in their source control provider so they can expose custom source control glyphs.

So, this time I though I should implement the function myself and see what's going on...

Of course, on first try I've hit the same problems reported by the customers :-). It turned out quickly that the problems come either from not setting up correctly the image size in the imagelist, from not setting correctly the transparency color, or not declaring the interface on the correct service.

If you're interested, I've put the sample for download on my website: Visual Studio Source Control Provider with Custom Glyphs.

The sample is based on the SccProvider sample in VisualStudio SDK, so you can Windiff the 2 solutions and easily see the code additions.

Here is how to test the new code:
1. Build the solution in VS2005 and run it.
2. In Tools/Options set the Sample Source Control Provider as the active provider (at this point the shell should call you on IVsSccGlyphs.GetCustomGlyphList to get the custom glyphs suported by your scc provider).
3. Create a new solution, e.g. a ConsoleApplication C# project.
4. Add the solution to source control
5. Add a new file to the project or to the solution
6. The new file should appear in SolutionExplorer with the new "pending add" icon exposed by the package, like in the picture below.

Custom glyph exposed by the sample scc provider