You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the result after I've run the version updated on an AssemblyInfo.cs file showing that the replacement only occurs on the first occurence in the file even if the line that it changes is commented, and subsequent uncommented AssemblyVersions are left unmodified...
// [assembly: AssemblyVersion("24.8.2.0")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("24.8.2.0")]
The text was updated successfully, but these errors were encountered:
Unfortunately, there is not much that can be done to skip these occurrences. I could add an extra check to exclude the lines that have two slashes at the beginning, but that will not affect multi-line comments or string literals like
Thanks for adding the error message! I like the idea of checking to exclude lines that begin with the // comment. I realize that doesn't catch the multi-line, but would certainly solve the bulk of cases and especially those comments that are typical in an AssemblyInfo.cs
Apart from the new error message for duplicate attributes, the action will now require the attributes to appear at the beginning of the line (after trimming whitespace characters). This will allow it to skip commented lines, e.g.
// [assembly: AssemblyVersion("1.2.3")]
but it will also skip attributes when they appear on the same line after another attribute:
This is the result after I've run the version updated on an AssemblyInfo.cs file showing that the replacement only occurs on the first occurence in the file even if the line that it changes is commented, and subsequent uncommented AssemblyVersions are left unmodified...
// [assembly: AssemblyVersion("24.8.2.0")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("24.8.2.0")]
The text was updated successfully, but these errors were encountered: