VS 2008 -> VS 2010 ASP.net conversion adds duplicate .designer.cs files RRS feed

  • Question

  • User-930126593 posted

    I'm trying to move a working ASP.NET application from VS 2008 to VS 2010. Currently .NET 3.5, move to 4.0.  Below happens before updating the .NET.

     Opening in VS 2010, it converts the projects.  Trying to build, I'm getting build errors about duplicate definitions such as:

    C:\TFS\GSPD\main - VS2010 - .net 3.5\GSPDWeb\GSPDWeb\DAL\DataSetMultiBrandBusinessFn.Designer.cs(255,30): error CS0102: The type 'GSPDWeb.DAL.DataSetMultiBrandBusinessFn' already contains a definition for 'RepMultipleBrandBusinessFnRowChangeEventHandler'


    I've narrowed this down that the project conversion for VS 2010 has created new files. These are in the DAL subfolder, database related.   There are now two copies of 4 files in the project, which I can also see in the .csproj file, such as:



    The *1.* is new, was not in the VS 2008 code base. In Windiff, I can see the new file *1.designer.cs has compiler directives added among other things, such as:

    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "")]

    The .csproj after conversion has entries for *both* files, so both compile, resulting in the duplicate defintion errors:

    <Compile Include="DAL\DataSetBrandBusinessFn.Designer.cs" />

    <Compile Include="DAL\DataSetBrandBusinessFn1.Designer.cs">






    I have to guess that Visual Studio is creating the *1.cs file during conversion to update to the newer project requirements, but not deciding which file to use past conversion. It shouldn't compile both, I'm getting compiler errors. VS probably wanted to replace the old one, with the new one. Maybe it keeps the old one for VS 2008 compatibility (which I don't plan to use any more)?

    Things seem to work if I use Solution Explorer to manually delete the old files.  The new ones are there, under the xsd files.  Application compiles file, and appears to work, but I haven't done heavy testing of the db yet.

    I'd feel better if I understood the real problem, and whether the above deletes are a fix or a hack, or whether there's another solution.

    VS 2010 version; 10.0.40219.1 SP1 rel. Can I assume that's Service Pack 1, so I shouldn't bother downloading that? The laptop was setup by work, so I didn't install it.


    Thursday, October 10, 2013 8:48 AM


All replies

  • User-930126593 posted

    Unless I get a reply, I'll assume my bright idea of deleting the old files using Solution Explorer is ok to do. 

    While it seems to work, I worry why I seem to be the only developer with this problem - I coudln't find it net surfing.  I assume its an environment (project specific) issue.


    Friday, October 11, 2013 2:59 PM
  • User-1426144113 posted


    Did you select back-up the project when upgrade? If so, please don't select back-up option.

    You can create a new simple project in the VS 2008 and try upgrade again, check whether is it can build sucess.

    This link may help you: http://www.codeproject.com/Tips/333623/Upgrading-VS-2008-projects-to-VS-2010-projects-wit


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, October 12, 2013 5:02 AM