Microsoft.VisualStudio.Project.ProjectNode.SaveMSBuildProjectFileAs C# (CSharp) Method

SaveMSBuildProjectFileAs() protected method

Saves project file related information to the new file name. It also calls msbuild API to save the project file. It is called by the SaveAs method and the SetEditLabel before the project file rename related events are triggered. An implementer can override this method to provide specialized semantics on how the project file is renamed in the msbuild file.
protected SaveMSBuildProjectFileAs ( string newFileName ) : void
newFileName string The new full path of the project file
return void
        protected virtual void SaveMSBuildProjectFileAs(string newFileName)
        {
            Debug.Assert(!String.IsNullOrEmpty(newFileName), "Cannot save project file for an empty or null file name");

            this.buildProject.FullPath = newFileName;

            this.filename = newFileName;

            string newFileNameWithoutExtension = Path.GetFileNameWithoutExtension(newFileName);

            // Refresh solution explorer
            this.SetProjectProperty(ProjectFileConstants.Name, newFileNameWithoutExtension);

            // Saves the project file on disk.
            this.buildProject.Save(newFileName);
        }
ProjectNode