CodeConverter icon indicating copy to clipboard operation
CodeConverter copied to clipboard

XML documentation setting prevents app from building in Release configuration

Open docfresh opened this issue 4 years ago • 1 comments

Steps to reproduce

  1. Have a VB app with XML Documentation checked in project settings, set to \bin\FixityVB.xml

  2. Convert to C#

  3. Change to release configuration

  4. App won't build. Error is: Error CS2021 File name ‘C:\dev\fixity\FixityVB\bin\’ is empty, contains invalid characters, has a drive specification without an absolute path, or is too long

  5. Go into project settings, change config from Debug to Release. Notice that when you change to Release, the XML documentation file changes from "bin\FixityVB.xml" to "bin\ .xml" (several blank spaces or invalid characters)

  6. Uncheck the XML documentation file box

  7. Recheck it

  8. File changes back to "bin\FixityVB.xml"

  9. Now the program will run under Release configuration.

Error message shown

Error CS2021 File name ‘C:\dev\fixity\FixityVB\bin\’ is empty, contains invalid characters, has a drive specification without an absolute path, or is too long

Details

CC 8.40

docfresh avatar Dec 13 '21 05:12 docfresh

Project file tweaks are handled by regexes here: https://github.com/icsharpcode/CodeConverter/blob/ccb288b5637c9d96285c3580d1e76275f4c0c4af/CodeConverter/Shared/ProjectConversion.cs#L122-L131

and here: https://github.com/icsharpcode/CodeConverter/blob/1a1e34979727bb469ca62fe0765cf0b7a9bc7242/CodeConverter/CSharp/VBToCSConversion.cs#L71-L83

The latter is probably the right place to fix this one - ideally with unit tests similar to these: https://github.com/icsharpcode/CodeConverter/blob/0c39437a1937283664cc3481c3faf9a9bf4b8854/Tests/LanguageAgnostic/ProjectFileTextEditorTests.cs#L11-L25

GrahamTheCoder avatar Dec 16 '21 12:12 GrahamTheCoder