Connecting Tech Pros Worldwide Forums | Help | Site Map

What does this error mean?

Steve Barnett
Guest
 
Posts: n/a
#1: Sep 26 '06
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



Dave Sexton
Guest
 
Posts: n/a
#2: Sep 26 '06

re: What does this error mean?


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" <noname@nodomain.comwrote in message news:eZXHG2X4GHA.3556@TK2MSFTNGP02.phx.gbl...
Quote:
>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
>

Steve Barnett
Guest
 
Posts: n/a
#3: Sep 26 '06

re: What does this error mean?


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:eYgRo$X4GHA.1544@TK2MSFTNGP04.phx.gbl...
Quote:
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" <noname@nodomain.comwrote in message
news:eZXHG2X4GHA.3556@TK2MSFTNGP02.phx.gbl...
Quote:
>>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
>>
>
>

pvdg42
Guest
 
Posts: n/a
#4: Sep 26 '06

re: What does this error mean?



"Steve Barnett" <noname@nodomain.comwrote in message
news:eZXHG2X4GHA.3556@TK2MSFTNGP02.phx.gbl...
Quote:
>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.


Steve Barnett
Guest
 
Posts: n/a
#5: Sep 26 '06

re: What does this error mean?



"pvdg42" <pvdg42@newsgroups.nospamwrote in message
news:upVPoJY4GHA.4740@TK2MSFTNGP03.phx.gbl...
Quote:
>
"Steve Barnett" <noname@nodomain.comwrote in message
news:eZXHG2X4GHA.3556@TK2MSFTNGP02.phx.gbl...
Quote:
>>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


Closed Thread