NuGetGallery.FunctionalTests.NuspecHelper.UpdateNuspecFile C# (CSharp) Method

UpdateNuspecFile() static private method

Given a nuspec file, this method will replace the search string with the replacement string.
static private UpdateNuspecFile ( string nuspecFilepath, string searchString, string replacementString ) : void
nuspecFilepath string
searchString string
replacementString string
return void
        internal static void UpdateNuspecFile(string nuspecFilepath, string searchString, string replacementString)
        {
            //Update contents Nuspec file.
            if (File.Exists(nuspecFilepath))
            {
                string specText = File.ReadAllText(nuspecFilepath);
                specText = specText.Replace(searchString, replacementString);
                File.WriteAllLines(nuspecFilepath, new[] { specText });
            }
        }
    }