By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,896 Members | 1,983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,896 IT Pros & Developers. It's quick & easy.

What does this error mean?

P: n/a
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
Sep 26 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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.

--
Dave Sexton

"Steve Barnett" <no****@nodomain.comwrote in message news:eZ**************@TK2MSFTNGP02.phx.gbl...
>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

Sep 26 '06 #2

P: n/a
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
"Dave Sexton" <dave@jwa[remove.this]online.comwrote in message
news:eY**************@TK2MSFTNGP04.phx.gbl...
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.

--
Dave Sexton

"Steve Barnett" <no****@nodomain.comwrote in message
news:eZ**************@TK2MSFTNGP02.phx.gbl...
>>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


Sep 26 '06 #3

P: n/a

"Steve Barnett" <no****@nodomain.comwrote in message
news:eZ**************@TK2MSFTNGP02.phx.gbl...
>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.

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Sep 26 '06 #4

P: n/a

"pvdg42" <pv****@newsgroups.nospamwrote in message
news:up**************@TK2MSFTNGP03.phx.gbl...
>
"Steve Barnett" <no****@nodomain.comwrote in message
news:eZ**************@TK2MSFTNGP02.phx.gbl...
>>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.

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
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
Sep 26 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.