Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Microsoft.VisualStudio.SolutionPersistence/Errors.resx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
</data>
<data name="InvalidName" xml:space="preserve">
<value>Names cannot:
- contain any of the following characters: / ? : \ * " &lt; &gt; | # &amp; %
- contain any of the following characters: / ? : \ * " &lt; &gt; |
- contain control characters
- be system reserved names, including 'CON', 'AUX', 'PRN', 'COM1' or 'LPT2'
- be '.' or '..'</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ namespace Microsoft.VisualStudio.SolutionPersistence.Model;
public sealed class SolutionModel : PropertyContainerModel
{
#if NETFRAMEWORK
private const string InvalidNameChars = @"?:&\/*""<>|#%";
private const string InvalidNameChars = @"?:\/*""<>|";
#else
private static readonly SearchValues<char> InvalidNameChars = SearchValues.Create(@"?:&\/*""<>|#%");
private static readonly SearchValues<char> InvalidNameChars = SearchValues.Create(@"?:\/*""<>|");
#endif

private readonly VisualStudioProperties visualStudioProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,8 @@ public void ConfigurationName()
">",
"?",
"*",
"%",
":",
"|",
"&",
"%",
"con",
"com1",
"lpt9",
Expand Down Expand Up @@ -170,7 +167,7 @@ public void SolutionFolders()
string invalidNameError = Errors.InvalidName;

// Don't allow invalid characters
Assert.StartsWith(invalidNameError, Assert.ThrowsAny<ArgumentException>(() => solution.AddFolder("/Foo#/")).Message);
Assert.StartsWith(invalidNameError, Assert.ThrowsAny<ArgumentException>(() => solution.AddFolder("/Foo</")).Message);

// Don't allow reserved names
Assert.StartsWith(invalidNameError, Assert.ThrowsAny<ArgumentException>(() => solution.AddFolder("/LPT4/")).Message);
Expand Down