Generics function to work with the list of rows of Typed Dataset

I wanted to create common function, that will work with the list of rows of Typed  Dataset, e.g. List<MyTypedDataSet.MyTableDataRow). 
I've created a function that expects as a parameter List of base DataRow objects, i.e. List<DataRow>. But compiler showed error, that it unable to cast
List<MyTypedDataSet.MyTableDataRow) to List<DataRow>. It does make sense, but what are the valid options?
The one, that I've used, is actually collect MyTableDataRow into the list of base DataRow records.
E.g use something like the following
List<DataRow> rows= new List<DataRow>();
rows.Add(myTableDataRow); 
 
Another option is to create generic function, where typed parameter has constraint-derived form base DataRow class.
Below are tho methods, that implement 2 possible options.
        public static void DeleteRows(List<DataRow> rows, bool hideExceptions)
        {
            foreach (DataRow row in rows)
            {
                try
                {
                    row.Delete();
                }
                catch (Exception exc)
                {
                    if (hideExceptions == true)
                    {                    //nothing to do
                        Debug.Assert(false, "Why " + exc.ToString());
                    }
                    else
                    {
                        throw;
                    }
                }
            }
        }
        public static void DeleteRows<TRow>(List<TRow> rows, bool hideExceptions)  where TRow: DataRow
        {
            foreach (DataRow row in rows)
            {
                try
                {
                    row.Delete();
                }
                catch (Exception exc)
                {
                    if (hideExceptions == true)
                    {                    //nothing to do
                        Debug.Assert(false, "Why " + exc.ToString());
                    }
                    else
                    {
                        throw;
                    }
                }
            }
        }

Use WCF Message Logging

The post based on How to enable WCF tracing article
Open WCF Service Configuration Editor under VS 2008 Tools menu   or directly from installation folder (typically C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\SvcConfigEditor.exe
 
To enable WCF message logging
  1. Click the Diagnostics node, and expand it.

  2. Enable Message Logging on the right Tab

  3. To edit Message Logging settings, click the Message Logging node. You can edit the settings in the property grid.
  4. In particular ensure that MaxSizeOfMessageToLog is big enough to log all your messages.
 
To view trace file: 

Start Service Trace Viewer Tool (typically located at "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\SvcTraceViewer.exe"). 

Open message trace file, that was configured in WCF Service Configuration Editor previously(usualliy located in the root of your application).

 Select Message View tab, scroll to the bottom and click one of latest messages.If required press F5 to refresh list.

 In the Detail Pane (the bottom right pane in the view) use  Message  tab to see actual messages. 

BTW, I've submitted MS Connect suggestion to Add items "Save Message As" and "Print Message" to Detail Pane

 

My experience with upgrading TFS 2005 to TFS 2008

I can describe my feeling of mgration from TFS 2005 to TFS 2008 in one word-NIGHTMARE.
 

Summary of recommendations.

1.Create combined TFS 2008+SP1 setup as described in http://www.woodwardweb.com/vsts/creating_a_tfs.html and in the latest Team Foundation Installation Guide
3. If you are using fully-qualified domain names (FQDN, e.g., tfsserver.mycompany.com) , replace  the FQDN with NetBios name before update and restore after update.
4. Install SP2 for the SQL Server. 
5.In case of errors review C:\Documents and Settings\MyUSER\Local Settings\VSMsiLog####.txt . It is usually quite detailed. 

Problems in a sequence.

I've read a few links with tips about conversion and thought that I am ready:
 
 
Unrelated: If you need to migrate or synchronize with other version control (VC) and work-item tracking (WIT) systems , look at  CodePlex TFS Migration and Synchronization Toolkit   
 
I've done all preliminary work as it was recommended.
When I've started installation, I've got TF220066 error.
The article Visual Studio 2008 Team Foundation Server - Error TF220066 and TF30170 among others suggests to install SP2 for the SQL Server (TFS documentation requires only SP1).
I've install it and also uninstall TFS 2005(not mandatory, but recommended step).
And TF220066 error has been replaced with new one- TF220064 
 
 
In the database TfsIntegration..tbl_service_interface replace 3 ReportsService  with Netbios name
 
The next error I noticed  in the log C:\Documents and Settings\MyUSER\Local Settings\dd_install_vstf_at_90.txt.
MS post  TFS/Team Explorer 2008 Troubleshooting Guide suggests to look fot logs in both %temp% and %temp%\.. (the parent dir of %temp%). 
 
[09/23/08,00:07:22] TFSUI: getcurrenttfsproperties.exe: === WARNING: Unable to retrieve service account from the database. Failed to find TfsServiceAccount in database TfsIntegration table tbl_registration_extended_attributes
[09/23/08,00:07:22] TFSUI: getcurrenttfsproperties.exe: === WARNING: Unable to determine TfsServiceAccount.
In the  TfsIntegration.tbl_registration_extended_attributes  table I manually added fk_registration_entry_id=1, name=TfsServiceAccount value= TfsService
 
 
Next error:
[09/23/08,00:17:55] vs70uimgr: DisplayMessage_START:Setup has detected that the specified database server is already in use by another Team Foundation Server (services) computer. Click OK to configure this computer as a stand-by Team Foundation Server (services) computer. Click Cancel to specify a different database server.
In the same TfsIntegration.tbl_registration_extended_attributes I replaced for ATMachineName FQDN to NetBios name
The fix is described by  sdneel in the thread 
 
The next error message:
Error 32000.The Commandline '"d:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools\TfsDb.exe" upgrade /server:"MyServer" /property:"TFS_SERVICE_ACCOUNT=MyDomain\TFSSERVICE;TFS_REPORTING_ACCOUNT=MyDomain\TFSREPORTS;LCID=1033;
VSTF_AS_INSTANCE=MyServer;VSTF_AS_DATABASE=TFSWarehouse;VSTF_AS_ACCOUNT=" /showui:394070' returned non-zero value: 100.
Upgrading TFS 2005 to TFS 2008 shows how to grant domain\TFSReports and MyDomain\TFSSERVICE the appropriate permissions.
But it didn't help for me.
 
I found from http://support.microsoft.com/kb/955008 that VSMsiLog####.txt located in C:\Documents and Settings\MyUSER\Local Settings\ (note not in Temp subfolder) folder already has detailed info. If it is not enough, a few articles suggest to run the TFSdb tool from the command line (e.g. here ), Note that you should it when  "Retry   Cancel" message  still open.
Another article TFS 2008 Installation Escapades & Errors suggest to use verbose TFS installation logging
 
 So details of the Error 32000 are the following:
 
Upgrading the Warehouse Database (TfsWarehouse)
 d:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools\SetupWarehouse.exe
 -upgrade -int TfsIntegration -s WEBJET011 -d TfsWarehouse -c "d:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools\Warehouseschema.xml" -a "MyDomain\TFSSERVICE" -ra "MyDomain\TFSREPORTS" -asinst "WEBJET011" -asdbname "TFSWarehouse" -asacct ""
 d:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools\SetupWarehouse.exe -upgrade -int TfsIntegration -s WEBJET011 -d TfsWarehouse -c "d:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools\Warehouseschema.xml" -a "MyDomain\TFSSERVICE" -ra "MyDomain\TFSREPORTS" -asinst "WEBJET011" -asdbname "TFSWarehouse" -asacct ""
 An unexpected error occurred: XML parsing failed at line 1, column 0: A document must contain exactly one root element.
 .
 Errors in the metadata manager. An error occurred when instantiating a metadata object from the file, '\\?\D:\Program Files\Microsoft SQL Server\MSSQL.2\OLAP\Data\TFSWarehouse.0.db\Outcome.622.dim.xml'.
 5
 d:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools\SetupWarehouse.exe 5 20547
 Microsoft.TeamFoundation.DatabaseInstaller.DatabaseException: d:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools\SetupWarehouse.exe 5 20547
   at Microsoft.TeamFoundation.DatabaseInstaller.ProcessDeployer.ExecuteCommand(String filePath, String arguments, Boolean continueOnError)
Microsoft.TeamFoundation.DatabaseInstaller.DatabaseException: d:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools\SetupWarehouse.exe 5 20547
   at Microsoft.TeamFoundation.DatabaseInstaller.ProcessDeployer.ExecuteCommand(String filePath, String arguments, Boolean continueOnError)
   at Microsoft.TeamFoundation.DatabaseInstaller.Installer.RunDbActions(InstallerMode mode, String server, Boolean preview)
   at Microsoft.TeamFoundation.DatabaseInstaller.Installer.RunSteps(InstallerMode mode, String server, IPropertyCollection properties, Boolean preview)
   at Microsoft.TeamFoundation.DatabaseInstaller.Installer.Upgrade(String server, IPropertyCollection properties, Boolean preview)
   at Microsoft.TeamFoundation.DatabaseInstaller.CommandLine.Commands.CommandUpgrade.OnRun()
   at Microsoft.TeamFoundation.DatabaseInstaller.CommandLine.Commands.InstallerCommand.Run()
   at Microsoft.TeamFoundation.DatabaseInstaller.CommandLine.CommandLine.RunCommand(String args)
 
As it suggested in

http://translate.google.com.au/translate?hl=en&sl=fr&u=http://batswirl.com/blogs/batswirl_fr/archive/2008/04/29/erreur-32000-lors-de-la-migration-de-tfs-2008.aspx&sa=X&oi=translate&resnum=7&ct=result&prev=/search%3Fq%3DTFSWarehouse%2BXML%2BTfsDb%26hl%3Den%26sa%3DG

 
I've just deleted the problematic xml file.
 
The next issue:Upgrade hang after "Starting execution of steps from step06_MigrateOpenedWorkItems.sql.resources", 
According to the thread http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3910016&SiteID=1&mode=1  Microsoft “have identified a fix and are currently testing the fix.  Please contact Customer Support for this issue.  It's currently be tracked under Escalation ID:  372448.” 
But Customer Support  was not aware about the number.
The install failed after 6 hours and growing TEMPDB to more than 50GB with "Disk Full" message.
Fortunately Buck Hodges was so nice to suggest how to install combined TFS 2008+SP1 setup as described in http://www.woodwardweb.com/vsts/creating_a_tfs.html and in the latest Team Foundation Installation Guide.
 
I installed VS 2008 with SP1 prior to the running combined TFS 2008+SP1 setup
 
The setup failed with Error 29250.Team Build Upgrade failed to complete successfully.
 
I was able to hack the errors by manually adding missing columns tbl_Build.DropLocationRoot and REASON and tbl_Schedule.LastEvaluatedOn
 
After this the TFS 2008 setup has been completed successfully.
 
To restore fully-qualified domain names (FQDN, e.g., tfsserver.mycompany.com) for TFS 
But command "tfsadminutil activateat <FullyQualifiedDomainName>" changed all references and Team client on my TFS server didn't see connection using Netbios name(e.g. http://tfsserver).
and for  (FQDN, e.g., tfsserver.mycompany.com) it wasn't able to authenticate user (Logon failure for NTLM).
So I had manually in  TfsIntegration.tbl_registration_extended_attributes replace for ATMachineName back to FQDN
Install removed SSL settings on the TFS virtual directory, and I had to restore reference to certificates.
 
Actually I tried to use http: instead of https, but for remote machines outside TFS domain I wasn't able to pass domain credentials(the same login failure).
Fortunately  for remote machines  connection https://tfsserver.mycompany.com works (as it worked before. I still not sure why http doesn't work.
 
Surprisely, installation of TFS build and upgrade WSS 2.0 to WSS 3.0 was done without any issues.
But after this I am not able to open Project Portals(access is denied for the user).
  • /SharepointURI:http://wssserver:80 
  • /SharepointSitesUri:http://<wssserver:80/sites
  • /SharepointAdminUri:http://wssserver:adminport
  • /SharepointUnc:\\wssserver\sites

and do not forget to  Migrate content or sites after upgrade (Windows SharePoint Services).

Set div to the vertical middle of the browser window

Our application shows custom HTML confirm message box, that we wanted to locate in the middle of the browser window.
If I would start from the scratch, I would use Ajax Control Toolkit  ModalPopup  
 
However, because the proprietary code to show div has been already written, I wanted just to set vertical position of the div.
 
I've created a function based on code from AlwaysVisibleControlExtender.js.
Initially it didn't work, because common.JS getClientBounds : function()  returned 0 clientHeight and clientWidth.
It is actually a known bug in ASP.NET AJAX documentation Control Toolkit, because for  

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > it is required to use
document.body.clientWidth instead of document.documentElement.clientWidth.

 

 
The created function is below. (I hope that I am compliant with http://www.codeplex.com/AjaxControlToolkit/license)
 

function SetVerticalMiddle(element)

{

    //Derived from http://www.asp.net/AJAX/AjaxControlToolkit/Samples/AlwaysVisibleControl/AlwaysVisibleControl.aspx AjaxControlToolkit.VerticalSide.Middle

    var y = 0;

    // Compute the width and height of the client

    // var CommonToolkitScripts = new AjaxControlToolkit._CommonToolkitScripts();

    // var clientBounds = CommonToolkitScripts.getClientBounds();

    // debugger;

    // var width = clientBounds.width;

    var height = getClientHeight();//clientBounds.height;

    if (document.documentElement && document.documentElement.scrollTop) {

        // x = document.documentElement.scrollLeft;

        y = document.documentElement.scrollTop;

    }

    else {

        // x = document.body.scrollLeft;

        y = document.body.scrollTop;

    }

    // Compute the coordinates

    // x = Math.max(0, Math.floor(x + width / 2.0 - element.offsetWidth / 2.0 ));

    y = Math.max(0, Math.floor(y + height / 2.0 - element.offsetHeight / 2.0 ));

    // element.style.left = x + 'px';

    element.style.top = y + 'px';

}

//copied from AjaxControlToolkit\Common\Common.js, fix from http://forums.asp.net/p/1002123/1323677.aspx#1323677

function getClientHeight() {

    /// <summary>

    /// Gets the height of the browser client window (excluding scrollbars)

    /// </summary>

    /// Browser's client height

    /// </returns>

    // var clientWidth;

 

    var clientHeight;

    switch(Sys.Browser.agent) {

    case Sys.Browser.InternetExplorer:

    // if (document.documentElement && document.documentElement.clientWidth)

    // clientWidth = document.documentElement.clientWidth;

    // else if (document.body)

    // clientWidth = document.body.clientWidth;

 

        if (document.documentElement && document.documentElement.clientHeight)

            clientHeight = document.documentElement.clientHeight;

        else if (document.body)

            clientHeight = document.body.clientHeight;

    break;

        // clientWidth = document.documentElement.clientWidth;

        clientHeight = document.documentElement.clientHeight;

    break;

    case Sys.Browser.Safari:

        // clientWidth = window.innerWidth;

        clientHeight = window.innerHeight;

    break;

    case Sys.Browser.Opera:

        // clientWidth = Math.min(window.innerWidth, document.body.clientWidth);

        clientHeight = Math.min(window.innerHeight, document.body.clientHeight);

    break;

    default: // Sys.Browser.Firefox, etc.

        // clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);

        clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);

    break;

    }

    return clientHeight;//new Sys.UI.Bounds(0, 0, clientWidth, clientHeight);

}

 

I wasn't able to use position:fixed (that supported by FireFox and IE 7) because the existing div is already inside DOM and not positioned properly without major changes of existing code.(There a a few posts describing hacks(too complicated and restrictive), how to emulate "fixed" in older browsers, e.g. IE 6 workaround for position:fixed,  Making IE 5.5+ use position: fixed ;position:fixed for Internet Explorer)
  
A few links about ASP.NET AJAX documentation Control Toolkit  ModalPopup:
 

Javascript variable declaration scope is different from C#.

It's well known that JavaScript is similar to C++/C#, but doesn't required explicit declaration of the variables.
However, it worth to read specification(e.g.  http://jennifermadden.com/javascript/variables.html )  to understand subtle differences.
 
I didn't know, that a variable implicitly declared within a function is  a global variable.
For example,
function foo() {
        g= 17;//it's global, will be visible outside the function after the function will be executed
          var x = 17;//local, not visible outside the function
}
          foo();
          println(g);//17
          println(x);//undefined
 
another rule(UPDATE:known browsers do not support it) : Depending on the system in which JavaScript is embedded, other objects whose scopes enclose the function currently executing (if any) are searched, starting from the innermost object, for a property identified by the simple name. If found, the simple name's scope is the object containing the property.
I understood the rule as it is not nesessary to pass local variables as parameters to calling function, but the calling function can see parents variables.
 
function foo() {
         var x = 17;//local, but should be visible in calling function according to the rule
         foo1();   
}
function foo1() {
          println(x);//should be 17 if called from foo, but known browsers do not support it.
}
However as it was pointed by Nitin Reddy Katkam,  neither Firefox's nor Internet Explorer's nor Safari implementation of Javascript  support this rule.
Also note, that in JavaScript constructor var can be used to implement private members and this to implement public fields. See "Private Members in JavaScript" article.

Select "Both Relation and Foreign Key Constraint" when creating relationship in VS Dataset designer.

MS VS Dataset Designer  allows to create a relationship (a DataRelation object) that maintains information about parent-child records in two data tables in a dataset using Relation Dialog Box.
It has option to specify type of relationship:
Both Relation and Foreign Key Constraint

Creates both a relation and foreign key constraint (see below for descriptions).

Foreign Key Constraint Only

A ForeignKeyConstraint restricts the action performed when a value in a column (or columns) is either deleted or updated.

Relation Only

A DataRelation is used to relate two DataTable objects to each other through DataColumn objects.

The default is "Relation Only", and it causes problems, if your code  modifies primary key of referenced table and you expected cascade updates.
 
Based on my experience, it is better to use "Both Relation and Foreign Key Constraint" and specify 
Update and Delete rules as  Rule.Cascade .

May be the VS Relation Dialog Box.should not specify the defaut, but force developer to make consious desision.

Javascript to re-calculate summary based on user drop-down lists selections

I wanted to implement client javascript to re-calculate summary based on a few options(in drop-down lists) selected by the user .
The closest JS sample I found  was  Complex Client-Side Shopping Cart .But it wasn't exactly what I wanted.
 
I created an array of custom class objects. Class has InitialPrice and SelectedPrice properties as well as

this.Diff = function( ) {
return this.SelectedPrice-this.InitialPrice; 
}
 

Each DropDownList  calls onchange Event Handler, which updates SelectedPrice value and calls RecalculateTotal();

 The RecalculateTotal() basically does the following:

var totalDiff=0.0;
for(var i=0; i<g_arrOpnClasses.length;i++)
{
var opnClass= g_arrOpnClasses[i];
totalDiff=totalDiff+opnClass.Diff();
}

and shows recalculated summary.

  
Because it was my first JS code with classes, I've read a few articles to solve problems, that I meet: 
 
 
To access the HTML element the event took place on:
Event Object for IE and Firefox.
function count(evt) {
var evt = evt || event;
var myObject = evt.target || evt.srcElement;
 
and more complicated (but more generic) approach described at How To Create A Global Event Object For Both IE and FireFox
 
Considered to use JSON
To populate initial values in array I considered to use JSON, but later found that it is not nesessary. Any way below are a few links that were informative for me:

Developer should not use "Hide extensions for known file types" in Windows Explorer

One my colleague got a new PC and had a problem opening file using simple code(just from MSDN example ):
 
FileInfo fi1 = new FileInfo(relativePath);

        if (!fi1.Exists)
....
It showed that file doesn't exist. We've tried also File.Exists(relativePath), changed the path to absolule- the same result-
file is visible in Windows Explorer, but doesn't exist in code. Note that directory was shown in debugger as existing.
We've created(using Windows Explorer) a new Text file, named "test.txt" and tried to open it in code- the same "file not exist" problem.
We've checked different security settings- the same.
Finally I recognized, that  Windows Explorer was set to "Hide extensions for known file types" and file visible as "test.txt" was actually created as
test.txt.txt.
The lesson: developer (and any user who has understanding of file extensions) should never have "Hide extensions for known file types" in Windows Explorer.
By the way: If you want to use a relative path from Windows Service, reset current directory  in the code
System.IO.Directory.SetCurrentDirectory (System.AppDomain.CurrentDomain.BaseDirectory);

Convert DataSet and DataTable to Xml String helper functions

I created 2 helper functions(can be modified as extensions in .Net Framework 3.5) to output/trace content of DataSet  or DataTable
public static string ToStringAsXml(DataSet ds)

{

 StringWriter sw = new StringWriter();
ds.WriteXml(sw, XmlWriteMode.IgnoreSchema);

string s = sw.ToString();

return s;

}
 

public static string ToStringAsXml(DataTable dt)
{
 StringWriter sw = new StringWriter();
dt.WriteXml(sw, XmlWriteMode.IgnoreSchema);
string s = sw.ToString();
return s;

}

DataRow.SetParentRow Method

I've noticed an existence of DataRow.SetParentRow Method.
MSDN documentation is quite brief: Sets the parent row of a DataRow with specified new parent DataRow.
 
It wasn't clear does the functions fills foreign key values in the child row from the parent one.
Thanks to Reflector, I confirmed, that it does SetKeyValues .
 
Please note that from performance point of view it is important to call SetParentRow first and add the childRow to the child table later..

Shortkey Alt-B,U is ambiguous in Visual Studio 2008 team edition

 
In Visual Studio I like to use shortkey Alt-B,U to start build of the current project.
However in VS 2008 team edition it doesn't start the build, but just opens menu and waits for extra "Enter" click.
The reason is that on the Build menu,there is extra "Queue new build" menu item with the same u shortcut, which conflicts with "Build Project"  menu item.
Issue reported to MS Connect.
 
Is it possible to change alt shortkeys for standard menu items?

I know that I can assign new shortkeys using Customize, but my hands need  to remember this new key, and my preference is to hide-disable  shortkey for
"Queue new build" , which I am not using anyway.

QuickCode.Net 2008 new TAB shortcut key

QuickCode.Net  has a new free 2008 version.

UPDATE: in a new release 3.0.6. it's possible to assign any shortcut key. In VS 2008  Customise keyboard  I've selected command QuickCode2008.AddIn.ReplaceQuickCode  and assigned a shortcut key Alt-Q.

It uses <TAB> instead of previously assigned Alt-Q hotkey.

<TAB> is consistent with standard VS snippets.

 If you press the TAB key after your QuickCode, e.g.

tc<TAB>

the QuickCode will expand.

If the same pattern exists in snippets and QuickCode, the VS snippet goes first. QuickCode deliberately does NOT expand QuickCodes while Intellisense is active.

After some use of new QuickCode.Net 2008  I understood that I prefer old Alt-Q , not new Tab

 

 The reasons for this are the following:
1. when typing, because of active Intellisense list it usually requires to do <ESC> to clear list , and only then <Tab> , instead of simple <Tab>
2. To clicking <Tab>, you need to be at the end of line.
E.g. if you typed your macro and want to fix typo in the middle of the line , you neet to go to the end of the line next.
Alt-Q didn't have this requirement.
3. Parameter with spaces doesn't work with TAB.
E.g. I have a macro
#r Region description with spaces
that converts into
#region  "Region description with spaces"
#endregion  //"Region description with spaces"

It worked with Alt-Q, but when using TAB, spaces within parameter are not supported.

Ideally it would be good if QuickCode  will support both keys. 

Related link(s):

My older post: QuickCode commands file location

 

"Login failed for user" may mean "database name is invalid"

One of my colleagues tried to work with a new database from DevServer and got an error "Login failed for user".
We checked everything related to security and permissions, but it didn't help.
After a while we recognize that there was spelling mistake in the name of the database in connection string.
In this case  "Login failed for user" error actually meant  "database name is invalid"
 
Why it wasn't shown as a reason in plain English?
 
Other possible reason for the errors are described in multiple articles, including following:

Generate C# class from XSD file.

I have an existing C# file, generated a long time ago from XSD definition.
The XSD files were changed, and proxy class should be regenerated.
I've tried to use XML Schema Definition Tool (Xsd.exe) to generate C# class, but it  returned the error: "The datatype is missing".
I've actually have two XSD files -outer and imported
Thanks to the post: XSD.exe is kicking my butt, man...redux , it pointed me to specify all necessary files on the commandline.
Note that name of generated file is combined from the files listed
  
I've created the batch file to be able to rerun it  
CallXSD.BAT
@call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86
xsd.exe outer.xsd imported.xsd /classes /l:cs /n:MyNamespace
rem rename  outer_imported.cs as outer.cs 
pause
By some reason the generated file created in some non-default encoding, which inserts 3 characters
 in the beginning.It is a minor annoyance, but when I delete them, VS shows me a warning, that wrong encoding could prevent keeping history.
 
The next issue was that the new XSD(.Net Framework 2.0 and 3.5) generates C# classes differently with what 1.0/1.1 XSD.exe did.
In a few places 1.1 version generated custom collection of objects, but new XSD.EXE generates array of objects, so I have to change the calls to generated classes.

I should try An XSD to .NET language code class generator that adds real punch to Microsoft's XSD Tool.
or Sample Code Generator 1.4.2.1

Another issue was that authors of XSD file added   xsd:choice  elements and it creates extra ItemsChoiceType array and enum.I described how I addressed it in my post XmlChoiceCollection class to access XSD generated properties for choice XML elements

 

 
That's pity, that minor changes in XSD file causes different class properties to be generated and essential code  changes to access the new properties.

Visual studio 2008 "Build action" properties: Shadow and CodeAnalysisDictionary

I've noticed that in Visual Studio 2008  files have additional "Build action" properties: Shadow and CodeAnalysisDictionary.
I've tried to find their meaning on Google but without success.
Does anyone know,what they suppose to do?
«October»
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678