What does this error mean?

  • Thread starter Thread starter Steve Barnett
  • Start date Start date
S

Steve Barnett

I copied and paste a form in my solution and renamed the copy (all done in
the solution explorer) and now, when I compile the app, I get the following
error:

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

I have no idea what it's trying to tell me and even less idea how to fix
this. Any suggestions? Double clicking on the error takes me nowhere, so I
take it it's a build error, but where to look?

If I remove the form from the solution, it compiles Ok, but that's somewhat
unhelpful since I need the form!! I'm using VS2005/C#.

Thanks
Steve
 
Hi Steve,

I suspect that you only renamed the .cs file and its class. You must also rename the related files (click the plus sign in solution
explorer) and the partial class in .designer.cs.
 
Actually, it's turned out to be worse than that - I feel so stupid for not
realising what went on.

Having copied the form (and got a bunch of files called Copy of Formx) I
renamed the form in Solution Explorer. It very kindly went through my code
and refactored the lot, including the original form so, while the file names
were different, the class names in the source were the same.

I think I just went off refactoring.

Thanks
Steve
 
Steve Barnett said:
I copied and paste a form in my solution and renamed the copy (all done in
the solution explorer) and now, when I compile the app, I get the following
error:

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

I have no idea what it's trying to tell me and even less idea how to fix
this. Any suggestions? Double clicking on the error takes me nowhere, so I
take it it's a build error, but where to look?

If I remove the form from the solution, it compiles Ok, but that's
somewhat unhelpful since I need the form!! I'm using VS2005/C#.

Thanks
Steve
It would appear that when you copy and paste a form, then rename the copy,
that VS 2005 inappropriately alters code in <first form name>.cs and <first
form name>Designer.cs.

I'd not seen this behavior, as I don't copy forms, but I'll bet it has
already been reposted as a bug (Somebody will correct me if I'm wrong, I'm
sure :) ).
To fix it, edit the files cited above, which incorrectly use the name of
your new, renamed form, to use the original form name. Your project should
then compile.
 
pvdg42 said:
It would appear that when you copy and paste a form, then rename the copy,
that VS 2005 inappropriately alters code in <first form name>.cs and
<first form name>Designer.cs.

I'd not seen this behavior, as I don't copy forms, but I'll bet it has
already been reposted as a bug (Somebody will correct me if I'm wrong, I'm
sure :) ).
To fix it, edit the files cited above, which incorrectly use the name of
your new, renamed form, to use the original form name. Your project should
then compile.

At some stage I want to turn this form in to a template, so the problem
should go away and I'll never need to copy the form again. In the short
term, I needed a copy for testing purposes. It's working now I've edited the
"other" form.

Net job is to learn how to create template forms!! Oh joy, another thing to
learn before I start the "real" development!

Thanks
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top