diff --git a/src/Microsoft.VisualStudio.SolutionPersistence/Errors.Designer.cs b/src/Microsoft.VisualStudio.SolutionPersistence/Errors.Designer.cs index 27949b96..1f985ed7 100644 --- a/src/Microsoft.VisualStudio.SolutionPersistence/Errors.Designer.cs +++ b/src/Microsoft.VisualStudio.SolutionPersistence/Errors.Designer.cs @@ -206,7 +206,7 @@ internal static string InvalidModelItem { /// /// Looks up a localized string similar to Names cannot: - ///- contain any of the following characters: / ? : \ * " < > | # & % + ///- contain any of the following characters: / ? : \ * " < > | ///- contain control characters ///- be system reserved names, including 'CON', 'AUX', 'PRN', 'COM1' or 'LPT2' ///- be '.' or '..'. diff --git a/src/Microsoft.VisualStudio.SolutionPersistence/Errors.resx b/src/Microsoft.VisualStudio.SolutionPersistence/Errors.resx index 6be5d561..a3755c1b 100644 --- a/src/Microsoft.VisualStudio.SolutionPersistence/Errors.resx +++ b/src/Microsoft.VisualStudio.SolutionPersistence/Errors.resx @@ -199,7 +199,7 @@ Names cannot: -- contain any of the following characters: / ? : \ * " < > | # & % +- contain any of the following characters: / ? : \ * " < > | - contain control characters - be system reserved names, including 'CON', 'AUX', 'PRN', 'COM1' or 'LPT2' - be '.' or '..' diff --git a/src/Microsoft.VisualStudio.SolutionPersistence/Model/SolutionModel.cs b/src/Microsoft.VisualStudio.SolutionPersistence/Model/SolutionModel.cs index cf273d43..5d94160d 100644 --- a/src/Microsoft.VisualStudio.SolutionPersistence/Model/SolutionModel.cs +++ b/src/Microsoft.VisualStudio.SolutionPersistence/Model/SolutionModel.cs @@ -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 InvalidNameChars = SearchValues.Create(@"?:&\/*""<>|#%"); + private static readonly SearchValues InvalidNameChars = SearchValues.Create(@"?:\/*""<>|"); #endif private readonly VisualStudioProperties visualStudioProperties; diff --git a/test/Microsoft.VisualStudio.SolutionPersistence.Tests/Serialization/Validation.cs b/test/Microsoft.VisualStudio.SolutionPersistence.Tests/Serialization/Validation.cs index c240433b..9e260333 100644 --- a/test/Microsoft.VisualStudio.SolutionPersistence.Tests/Serialization/Validation.cs +++ b/test/Microsoft.VisualStudio.SolutionPersistence.Tests/Serialization/Validation.cs @@ -88,11 +88,8 @@ public void ConfigurationName() ">", "?", "*", - "%", ":", "|", - "&", - "%", "con", "com1", "lpt9", @@ -170,7 +167,7 @@ public void SolutionFolders() string invalidNameError = Errors.InvalidName; // Don't allow invalid characters - Assert.StartsWith(invalidNameError, Assert.ThrowsAny(() => solution.AddFolder("/Foo#/")).Message); + Assert.StartsWith(invalidNameError, Assert.ThrowsAny(() => solution.AddFolder("/Foo(() => solution.AddFolder("/LPT4/")).Message);