My company uses a combination of some database tables, a web page front end and an \"export\" application to handle our string resources in our web sites.
The export
I had a problem where VS 2010 would not regenerate the Designer.cs files, and couldn't find the solution elsewhere.
I was able to regenerate them though, without going to the command line.
To fix the issue in Visual Studio 2010 I did the following:
Run Custom Tool
That rebuilt the Designer.cs file.
Hope that might help someone else in the future..
Try this:
Save and build again. Problem solved.
From MSDN we have:
Compiling Resources into Assemblies
When you build your application, Visual Studio invokes the resgen.exe tool to convert your application resources into an internal class called Resources. This class is contained in the Resources.Designer.cs file which is nested under the Resources.resx file in Solution Explorer. The Resources class encapsulates all your project resources into static readonly get properties as a way of providing strongly-typed resources at run-time. When you build through the Visual C# IDE, all the encapsulated resource data, including both the resources that were embedded into the .resx file and the linked files, is compiled directly into the application assembly (the .exe or .dll file). In other words, the Visual C# IDE always uses the /resource compiler option. If you build from the command line, you can specify the /linkresource compiler option that will enable you to deploy resources in a separate file from the main application assembly. This is an advanced scenario and is only necessary in certain rare situations.
If you prefer to automatically generate the *.designer.cs files from *.resx files when building the project, the following approach worked for us and it might work for you as well:
<Target Name="GenerateDesignerFiles"> <Message Text="Deleting old Designer Files..."/> <Delete Files="@(EmbeddedResource->'%(RootDir)%(Directory)%(Filename).resources')"/> <Delete Files="@(EmbeddedResource->'%(RootDir)%(Directory)%(Filename).designer.cs')"/> <Message Text="Generating Designer Files..."/> <GenerateResource Sources="@(EmbeddedResource)" StronglyTypedLanguage="C#" StronglyTypedClassName="%(Filename)" StronglyTypedNamespace="@(EmbeddedResource->'%(CustomToolNamespace)')" StronglyTypedFileName="@(EmbeddedResource->'%(RootDir)%(Directory)%(Filename).designer.cs')" PublicClass="true" > </GenerateResource> <Message Text="Generating Designer Files complete."/> </Target>
<Target Name="BeforeBuild"> <CallTarget Targets="GenerateDesignerFiles"/> </Target>
This solution is based on all resource files being listed as "EmbeddedResource" within an ItemGroup of the project file, e.g.
<ItemGroup> <EmbeddedResource Include="Resources\Creditor\Display_Creditor.resx"> <Generator>PublicResXFileCodeGenerator</Generator> <LastGenOutput>Display_Creditor.Designer.cs</LastGenOutput> <CustomToolNamespace>Acme.Web.Resources.Creditor</CustomToolNamespace> </EmbeddedResource> <EmbeddedResource Include="Resources\InboundEmail\Tooltip_InboundEmailDetails.resx"> <Generator>PublicResXFileCodeGenerator</Generator> <LastGenOutput>Tooltip_InboundEmailDetails.Designer.cs</LastGenOutput> <CustomToolNamespace>Acme.Web.Resources.InboundEmail</CustomToolNamespace> </EmbeddedResource> <EmbeddedResource Include="Resources\Creditor\Tooltip_CreditorDetails.resx"> <Generator>PublicResXFileCodeGenerator</Generator> <LastGenOutput>Tooltip_CreditorDetails.Designer.cs</LastGenOutput> <CustomToolNamespace>Acme.Web.Resources.Creditor</CustomToolNamespace> </EmbeddedResource> </ItemGroup>
Disclaimer: This has been tested with Visual Studio 2013 and C# projects. It may or may not work for other projects and/or other versions of Visual Studio.
Following these steps worked for me.