Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResXFileCodeGenerator creates code which triggers warnings (CS1570) #25531

Open
cptjazz opened this issue Mar 16, 2018 · 0 comments
Open

ResXFileCodeGenerator creates code which triggers warnings (CS1570) #25531

cptjazz opened this issue Mar 16, 2018 · 0 comments
Assignees
Milestone

Comments

@cptjazz
Copy link

cptjazz commented Mar 16, 2018

Version Used:
VS2017 (15.6.2)

Steps to Reproduce:

  1. Add a resx Resource File to your project
  2. Define a key "Test" with the following multiline value:
    MyTest
    /asdf
  3. In your project settings activate "Treat warnings as errors". Also activate "XML documentation file".
  4. Compile

Expected Behavior:

No warnings (that are treated as errors) for automatically generated code.

The ResXFileCodeGenerator should have escaped the slash in the XML comment with &#47;. It already escapes characters like < and >.

Or: it should have inserted a space after the leading /// that start the XML comment.

Actual Behavior:

The compiler generates warnings (that are treated as errors) for the automatically generated property.

Error CS1570 XML comment has badly formed XML -- 'summary'
Error CS1570 XML comment has badly formed XML -- '{0}'

The generated code looks like:

/// <summary>
///   Looks up a localized string similar to MyTest
////asdf.
/// </summary>
internal static string Test {
    get {
        return ResourceManager.GetString("Test", resourceCulture);
    }
}

The problem here is the slash ("/") in the second line of the resource text.

Since all projects in my team enforce "treat warnings as errors" this effectively leads to a non-compiling project.

@jinujoseph jinujoseph added this to the 15.8 milestone Jun 26, 2018
@jinujoseph jinujoseph modified the milestones: 15.8, 16.0 Sep 17, 2018
@jinujoseph jinujoseph modified the milestones: 16.0, Backlog Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants