In our ASP.NET MVC project we have a Strings.resx
file and the accompanying autogenerated Strings.Designer.cs
file.
Tracking the Strings.Designer.cs
file in source control creates a bunch of ugly merge conflicts and it's autogenerated anyway, so we decided to untrack it (remove it from source control and ignore the local copy of the file).
This works well, except that on a fresh checkout of the source the Strings.Designer.cs file doesn't exist. The PublicResXFileCodeGenerator
that generates the file from Strings.resx
balks with a warning:
"The custom tool 'PublicResXFileCodeGenerator' failed while processing the file 'Views\Setup\App_LocalResources\Strings.resx'."
And as a result, all of the strings in that file generate compile errors. This means you must manually right-click on each Strings.resx
file in the project and choose "Run Custom Tool".
Is there any way to get the ResX code generator tool to run automatically even if Strings.Designer.cs doesn't yet exist?
(We've experimented with ResGen but it is finicky--it refuses to generate Strings files with the proper filename and namespace.)