Skip to content

Turning on code generation for resource files with cultures in their names results in an error #1553

@davkean

Description

@davkean
  1. File -> New -> Console Application (.NET Core)
  2. Add New Resource called "Resource.en-US.resx

In the Error List:

Error		Custom tool PublicResXFileCodeGenerator failed to produce an output for input file 'Resource.en-US.resx' but did not log a specific error.	ConsoleApp181	c:\users\davkean\documents\visual studio 2017\Projects\ConsoleApp181\ConsoleApp181\Resource.en-US.resx	1	

Did some investigation - this appears to be (somewhat) by design by the code generator (seeResXFileCodeGenerator.GenerateCode) and has been it's behaviour since VS 2005 (yes 2005, not 2015). What is different in CPS though, is that it errors in this situation - whereas, the legacy project system outputs an empty source file.

Looking through the bug that caused them to implement this behavior was to avoid having both the neutral and the language-specific resource generate the same code and result in build errors. However, in some situations you don't have a neutral Resource file such as when your neutral resources end up in a satellite assembly. ie I don't think this behavior makes sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions