ScruffyDuck
ScruffyDuck

Reputation: 2666

VS2010 Compile Error

Apologies. I am sure I should know where to look to deal with this but I do not:

The error below has appeared in my solution. I am not aware of why.

The item "obj\Release\ScruffyDuck.AirportDesignEditor.MainForm.resources" was specified more than once in the "Resources" parameter. Duplicate items are not supported by the "Resources" parameter. Airport Design Editor

Perhaps someone would be kind enough to put me out of my misery and tell me where to look.

Thanks

Upvotes: 0

Views: 1317

Answers (3)

ScruffyDuck
ScruffyDuck

Reputation: 2666

OK I found it. I have no idea how it happened. However it might be useful for the future. MainForm has a number of files containing different parts of the class. The main part has all the designer code and so on. Somehow a .resx file got created on one of the partial class files along with an InitializeComponent() method. Removing the extra .resx file got as far as reporting the duplicate method and removing that allowed the solution to compile again. It seems that though the file names are different (the error was in MainForm.EventHandlers) the two resx files are treated as the same even though they have different names.

I am now getting some exceptions but at least I can get the code running in the debugger again.

Upvotes: 1

Tigran
Tigran

Reputation: 62246

  1. Just remove obj directory from HD manually.
  2. Clear solution from Visual Studio (Right click on project in SolutionExplorer and select "Clear")
  3. Rebuild solution.

Cause could be a fault of generated resource file, due some conflicts happened in your project.

Should work.

Regards.

Upvotes: 0

Andy
Andy

Reputation: 8562

I think you'll have to open your .csproj file, and look for that file name. It sounds like ScruffyDuck.AirportDesignEditor.MainForm.resources is appearing more than once. Just remove the duplicate node (.csproj files are just xml).

Upvotes: 0

Related Questions