locked
Duplicate Item "Resources" parameter error

    Question

  • I have a partial class in two files that inherit from a form. I changed a property on the form in both Form Designer Files and now keep getting this error message:

    The item "obj\Debug\Game.App.resources" was specified more than once in the "Resources" parameter. Duplicate items are not supported by the "Resources" parameter.

    Can anyone help? I only changed the FormBorderStyle and already changed it back, but keep getting the error message.

    Thank You

    Friday, May 19, 2006 1:13 AM

Answers

  • This usually happens when you copy a form without renaming types. Check the naming in the cs files and rename duplicate classes.
    Tuesday, May 23, 2006 5:19 PM
  • Nevermind, I just combined the two files and it solved the problem.
    Friday, May 19, 2006 1:28 AM

All replies

  • Nevermind, I just combined the two files and it solved the problem.
    Friday, May 19, 2006 1:28 AM
  • This usually happens when you copy a form without renaming types. Check the naming in the cs files and rename duplicate classes.
    Tuesday, May 23, 2006 5:19 PM
  • Thanks for the heads up with this. I recently noticed the new partial class support and how it helps to separate classes into several physical files - great!

    Using the <DependentUpon> node in the project XML I was able to add additional files for a form and split functionality into these files  to reduce the volume of code within the one file.

    To push the envelope I created two forms, I then made one of the forms a private inner classes within the other 'parent' form.

    viz.
    namespace TestApp1 {
        public partial class Form1: Form {
            private partial class MyDialog : Form {
                public MyDialog() {
                    InitializeComponent();
                }
            }
        }
    }

    Now when I compile I get this error:

    The item "obj\Debug\TestApp1.Form1.resources" was specified more than once in the "Resources" parameter.  Duplicate items are not supported by the "Resources" parameter.    TestApp1

    If I modify the form as follows...

    namespace TestApp1 {
        //public partial class Form1: Form {
            private partial class MyDialog : Form {
                public MyDialog() {
                    InitializeComponent();
                }
            }
        //}
    }


    All is well. Is this supposed to work and I have missed something or am I pushing my luck :-)

    Thanks in advance for any assistance!

    Andrew.
    Thursday, June 08, 2006 8:12 AM
  • You can open the project file. There will be a duplicate entry for the .cs, .designer.cs, and .resx file for file

    It happened to me when I overwrote a control with another abd built it.

    Thursday, June 15, 2006 8:04 AM