Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio resx editor creating duplicate designer file

On my current project whenever I add, update or delete a resource the tool creates a copy of the designer file which screws things up. I don't see this behavior with my other projects, and as far as I can tell I'm implementing resources the same way. Can anyone shed some light on this behavior? Thanks

like image 796
GDB Avatar asked Oct 13 '14 23:10

GDB


2 Answers

Visual studio 2017

The reference to the duplicated designer file is in the csproj file.

  • Close the solution
  • Edit your project .csproj
  • Locate the LastGenOutput tag
  • Remove the '1' on the designer file

You can now reload the solution. If you want to regenerate the designer file:

  • Delete it
  • Edit the resx file and save The new designer file is recreated.
like image 70
Eric Bole-Feysot Avatar answered Oct 12 '22 16:10

Eric Bole-Feysot


Unfortunately I have no idea what was causing this for me but after wasting a fair bit of time I found a work around which seems to of worked without issues for me.

I simply deleted the designer file and re-built my project. This automatically re-creates the designer file and everything continued to work as normal.

The only noticeable difference is the designer file now has a 1 on the end of it.

E.g. String.resx -> Strings1.Designer.cs

I have been making changes on and off to this file in the past with no issues. If anyone could explain what got it into this corrupt state, please share with us.

like image 30
Robert Avatar answered Oct 12 '22 15:10

Robert