Reputation: 1819
At work we use typed dataset in some projects for our DataAccess layer. Sometimes we extend them using the partial class feature : using View code on a dataset create a DataSetName.cs with the partial class declaration where you can add code. Inside this file we also add the TableAdapter partial class.
Recently we migrated on Visual Studio 2008 from VS 2005. The behavior of the dataset generator seems to be different in VS 2008. It removed a part in the TableAdapter namespace in the .cs file :
Example :
Original code :
namespace ClassLibrary1.Dataset.DataSet1TableAdapters
{
public partial class CategoriesTableAdapter
{
}
}
After migration in VS 2008 :
namespace ClassLibrary1.DataSet1TableAdapters
{
public partial class CategoriesTableAdapter
{
}
}
The namespace changed ! It has been replaced by the root namespace of the project.
Reproduction steps :
My Machine : Windows Server 2003 R2 Standard Edition SP2 Visual Studio 2008 Pro (9.0.21022.8 RTM) Also tested on a colleague's computer running XP.
Anyone already experiencied the same weird behavior ? Did I made something wrong ? Is there something new to configure inside Visual Studio 2008 to make it works like it did in VS 2005 ?
Upvotes: 1
Views: 1994
Reputation: 878
Having a namespace that is also a class name causes confusion. Microsoft apparently decided to fix a namespace generation bug in this case. I would recommend fixing your namespaces rather than trying to find some workaround to have it the old way.
Upvotes: 1