├── readme_files ├── fullrename.png ├── FullRenamer2017-11-13.vsix └── FullRenamer2019-12-19.vsix ├── src ├── RenameProjectVsExtension │ ├── Core.UnitTests │ │ ├── FakeProjectRenamer.cs │ │ ├── packages.config │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Core.UnitTests.csproj │ │ └── ProjectRenamerTests.cs │ ├── Core │ │ ├── packages.config │ │ ├── NamespaceRenamer.cs │ │ ├── StringExtensions.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── SharedTypeProjectRenamer.cs │ │ ├── Core.csproj │ │ └── ProjectRenamer.cs │ ├── VSIX │ │ ├── Resources │ │ │ ├── RenameCommand.png │ │ │ └── RenameCommandPackage.ico │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── source.extension.vsixmanifest │ │ ├── Helpers │ │ │ ├── MessageBoxHelper.cs │ │ │ ├── ProjectRenamerFactory.cs │ │ │ └── DteSolutionHelper.cs │ │ ├── packages.config │ │ ├── FullRenameDialog.xaml │ │ ├── FullRenameDialog.xaml.cs │ │ ├── RenameCommandPackage.cs │ │ ├── RenameCommandPackage.vsct │ │ ├── RenameCommand.cs │ │ ├── VSPackage.resx │ │ └── VSIX.csproj │ ├── ConsoleApp │ │ ├── App.config │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── ConsoleApp.csproj │ └── RenameProjectVsExtension.sln └── RenameProjectVs2015Extension │ ├── Core │ ├── packages.config │ ├── StringExtensions.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SharedTypeProjectRenamer.cs │ ├── Core.csproj │ └── ProjectRenamer.cs │ ├── RenameProjectVs2015Extension │ ├── Resources │ │ ├── RenameCommand.png │ │ └── RenameCommandPackage.ico │ ├── source.extension.vsixmanifest │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Helpers │ │ ├── MessageBoxHelper.cs │ │ └── DteSolutionHelper.cs │ ├── packages.config │ ├── RenameCommandPackage.cs │ ├── RenameCommandPackage.vsct │ ├── RenameCommand.cs │ ├── VSPackage.resx │ └── RenameProjectVs2015Extension.csproj │ └── RenameProjectVs2015Extension.sln ├── README.md ├── LICENSE ├── .gitattributes └── .gitignore /readme_files/fullrename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuanysh-nabiyev/RenameProjectVsExtension/HEAD/readme_files/fullrename.png -------------------------------------------------------------------------------- /readme_files/FullRenamer2017-11-13.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuanysh-nabiyev/RenameProjectVsExtension/HEAD/readme_files/FullRenamer2017-11-13.vsix -------------------------------------------------------------------------------- /readme_files/FullRenamer2019-12-19.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuanysh-nabiyev/RenameProjectVsExtension/HEAD/readme_files/FullRenamer2019-12-19.vsix -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/Core.UnitTests/FakeProjectRenamer.cs: -------------------------------------------------------------------------------- 1 | namespace Core.UnitTests 2 | { 3 | public class FakeProjectRenamer : ProjectRenamer 4 | { 5 | 6 | } 7 | } -------------------------------------------------------------------------------- /src/RenameProjectVs2015Extension/Core/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/Core.UnitTests/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/Core/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/VSIX/Resources/RenameCommand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuanysh-nabiyev/RenameProjectVsExtension/HEAD/src/RenameProjectVsExtension/VSIX/Resources/RenameCommand.png -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/VSIX/Resources/RenameCommandPackage.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuanysh-nabiyev/RenameProjectVsExtension/HEAD/src/RenameProjectVsExtension/VSIX/Resources/RenameCommandPackage.ico -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/ConsoleApp/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/RenameProjectVs2015Extension/RenameProjectVs2015Extension/Resources/RenameCommand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuanysh-nabiyev/RenameProjectVsExtension/HEAD/src/RenameProjectVs2015Extension/RenameProjectVs2015Extension/Resources/RenameCommand.png -------------------------------------------------------------------------------- /src/RenameProjectVs2015Extension/RenameProjectVs2015Extension/Resources/RenameCommandPackage.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kuanysh-nabiyev/RenameProjectVsExtension/HEAD/src/RenameProjectVs2015Extension/RenameProjectVs2015Extension/Resources/RenameCommandPackage.ico -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/Core/NamespaceRenamer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Core 4 | { 5 | public class NamespaceRenamer 6 | { 7 | public bool IsNecessaryToRename { get; set; } 8 | public IEnumerable ProjectFiles { get; set; } 9 | public IEnumerable SolutionFiles { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /src/RenameProjectVs2015Extension/Core/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Core 9 | { 10 | internal static class StringExtensions 11 | { 12 | public static string WrapWithTag(this string str, string tag) 13 | { 14 | return $"<{tag}>{str}"; 15 | } 16 | 17 | public static string ReplaceWithTag(this string sourceStr, string oldValue, string newValue, string tag) 18 | { 19 | return sourceStr.Replace(oldValue.WrapWithTag(tag), newValue.WrapWithTag(tag)); 20 | } 21 | 22 | public static string GetDirectoryName(this string str) 23 | { 24 | return Path.GetDirectoryName(str); 25 | } 26 | 27 | public static string GetFileName(this string str) 28 | { 29 | return Path.GetFileName(str); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/Core/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Core 9 | { 10 | internal static class StringExtensions 11 | { 12 | public static string WrapWithTag(this string str, string tag) 13 | { 14 | return $"<{tag}>{str}"; 15 | } 16 | 17 | public static string ReplaceWithTag(this string sourceStr, string oldValue, string newValue, string tag) 18 | { 19 | return sourceStr.Replace(oldValue.WrapWithTag(tag), newValue.WrapWithTag(tag)); 20 | } 21 | 22 | public static string GetDirectoryName(this string str) 23 | { 24 | return Path.GetDirectoryName(str); 25 | } 26 | 27 | public static string GetFileName(this string str) 28 | { 29 | return Path.GetFileName(str); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Rename project name in: 2 | - project location folder 3 | - solution file 4 | - reference in other projects 5 | - assembly name, information 6 | - default namespace 7 | 8 | Only tested for c# projects. 9 | 10 | It doesn't matter if project is located in solution folder (even for subfolder of solution folder) 11 | 12 | In case of error at any stage of renaming project, all changes will be rolled back. 13 | 14 | Download the latest version from [FullRenamer2019-12-19.vsix](https://github.com/kuanysh-nabiyev/RenameProjectVsExtension/blob/master/readme_files/FullRenamer2019-12-19.vsix) 15 | 16 | ![fullrename vs project](https://github.com/kuanysh-nabiyev/RenameProjectVsExtension/blob/master/readme_files/fullrename.png) 17 | 18 | #### If you got "Access to the path XXX is denied", try the following: 19 | https://github.com/kuanysh-nabiyev/RenameProjectVsExtension/issues/17#issuecomment-421806448 20 | https://github.com/kuanysh-nabiyev/RenameProjectVsExtension/issues/17#issuecomment-421811318 21 | 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 kuanysh-nabiyev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/VSIX/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("VSIX")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("VSIX")] 13 | [assembly: AssemblyCopyright("")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Version information for an assembly consists of the following four values: 23 | // 24 | // Major Version 25 | // Minor Version 26 | // Build Number 27 | // Revision 28 | // 29 | // You can specify all the values or you can default the Build and Revision Numbers 30 | // by using the '*' as shown below: 31 | // [assembly: AssemblyVersion("1.0.*")] 32 | [assembly: AssemblyVersion("1.0.0.0")] 33 | [assembly: AssemblyFileVersion("1.0.0.0")] 34 | -------------------------------------------------------------------------------- /src/RenameProjectVs2015Extension/RenameProjectVs2015Extension/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RenameProjectVs2015Extension 6 | Rename project name in: 7 | project location folder, 8 | solution, 9 | reference in other projects, 10 | assembly name, information 11 | default namespace 12 | rename, fullrename 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/RenameProjectVs2015Extension/RenameProjectVs2015Extension/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("RenameProjectVs2015Extension")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("RenameProjectVs2015Extension")] 13 | [assembly: AssemblyCopyright("")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Version information for an assembly consists of the following four values: 23 | // 24 | // Major Version 25 | // Minor Version 26 | // Build Number 27 | // Revision 28 | // 29 | // You can specify all the values or you can default the Build and Revision Numbers 30 | // by using the '*' as shown below: 31 | // [assembly: AssemblyVersion("1.0.*")] 32 | [assembly: AssemblyVersion("1.0.0.0")] 33 | [assembly: AssemblyFileVersion("1.0.0.0")] 34 | -------------------------------------------------------------------------------- /src/RenameProjectVs2015Extension/RenameProjectVs2015Extension/Helpers/MessageBoxHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.VisualStudio.Shell; 7 | using Microsoft.VisualStudio.Shell.Interop; 8 | 9 | namespace VSIX.Helpers 10 | { 11 | internal class MessageBoxHelper 12 | { 13 | private readonly IServiceProvider _serviceProvider; 14 | 15 | public MessageBoxHelper(IServiceProvider serviceProvider) 16 | { 17 | _serviceProvider = serviceProvider; 18 | } 19 | 20 | public void ShowSuccessMessage() 21 | { 22 | VsShellUtilities.ShowMessageBox( 23 | _serviceProvider, 24 | "Full rename was completed", 25 | "Success", 26 | OLEMSGICON.OLEMSGICON_INFO, 27 | OLEMSGBUTTON.OLEMSGBUTTON_OK, 28 | OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST); 29 | } 30 | 31 | public void ShowErrorMessage(Exception ex, string title = "Error") 32 | { 33 | VsShellUtilities.ShowMessageBox( 34 | _serviceProvider, 35 | $"{ex.Message}\n{ex.StackTrace}", 36 | title, 37 | OLEMSGICON.OLEMSGICON_CRITICAL, 38 | OLEMSGBUTTON.OLEMSGBUTTON_OK, 39 | OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/ConsoleApp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Core; 7 | 8 | namespace ConsoleApp 9 | { 10 | class Program 11 | { 12 | static void Main(string[] args) 13 | { 14 | var projectRenamer = new ProjectRenamer() 15 | { 16 | SolutionFullName = @"C:\Users\KUANYSH-PC\Documents\visual studio 2017\Projects\TestSolutionForRenaming\TestSolutionForRenaming.sln", 17 | ProjectFullName = @"C:\Users\KUANYSH-PC\Documents\visual studio 2017\Projects\TestSolutionForRenaming\TestProjectA\TestProjectA.csproj", 18 | ProjectName = "TestProjectA", 19 | ProjectUniqueName = @"TestProjectA\TestProjectA.csproj", 20 | ProjectNameNew = "TestProjectA_NewName", 21 | SolutionProjects = new List 22 | { 23 | @"C:\Users\KUANYSH-PC\Documents\visual studio 2017\Projects\TestSolutionForRenaming\TestProjectA\TestProjectA.csproj", 24 | @"C:\Users\KUANYSH-PC\Documents\visual studio 2017\Projects\TestSolutionForRenaming\TestProjectB\TestProjectB.csproj", 25 | @"C:\Users\KUANYSH-PC\Documents\visual studio 2017\Projects\TestSolutionForRenaming\TestProjectC\TestProjectC.csproj", 26 | } 27 | }; 28 | 29 | projectRenamer.FullRename(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Core")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Core")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("6b7e3634-3f22-4870-9e75-f1e0a4342659")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/RenameProjectVs2015Extension/Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Core")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Core")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("243c70e3-a440-41f1-a814-a169bcd2bf19")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/ConsoleApp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ConsoleApp")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ConsoleApp")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e463ddff-d375-405b-b06f-e64dfed0f68f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/Core.UnitTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Core.UnitTests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Core.UnitTests")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("09ebf39a-5d4e-4dd0-827f-6fe9ab5e26aa")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/RenameProjectVs2015Extension/RenameProjectVs2015Extension.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RenameProjectVs2015Extension", "RenameProjectVs2015Extension\RenameProjectVs2015Extension.csproj", "{0E4C9F39-2ADD-4349-B31F-A6A4AA5AEFB8}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "Core\Core.csproj", "{243C70E3-A440-41F1-A814-A169BCD2BF19}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {0E4C9F39-2ADD-4349-B31F-A6A4AA5AEFB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {0E4C9F39-2ADD-4349-B31F-A6A4AA5AEFB8}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {0E4C9F39-2ADD-4349-B31F-A6A4AA5AEFB8}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {0E4C9F39-2ADD-4349-B31F-A6A4AA5AEFB8}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {243C70E3-A440-41F1-A814-A169BCD2BF19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {243C70E3-A440-41F1-A814-A169BCD2BF19}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {243C70E3-A440-41F1-A814-A169BCD2BF19}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {243C70E3-A440-41F1-A814-A169BCD2BF19}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/VSIX/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Full Rename Project 6 | Rename project name in: 7 | project location folder, 8 | solution, 9 | reference in other projects, 10 | assembly name, information 11 | default namespace, 12 | class namespace in each project file 13 | fix bug: the property fullpath is not exist for some project items 14 | rename, fullrename 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/VSIX/Helpers/MessageBoxHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.VisualStudio.Shell; 7 | using Microsoft.VisualStudio.Shell.Interop; 8 | 9 | namespace VSIX.Helpers 10 | { 11 | internal class MessageBoxHelper 12 | { 13 | private readonly IServiceProvider _serviceProvider; 14 | 15 | public MessageBoxHelper(IServiceProvider serviceProvider) 16 | { 17 | _serviceProvider = serviceProvider; 18 | } 19 | 20 | public void ShowSuccessMessage() 21 | { 22 | VsShellUtilities.ShowMessageBox( 23 | _serviceProvider, 24 | "Full rename was completed", 25 | "Success", 26 | OLEMSGICON.OLEMSGICON_INFO, 27 | OLEMSGBUTTON.OLEMSGBUTTON_OK, 28 | OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST); 29 | } 30 | 31 | public void ShowErrorMessage(Exception ex, string title = "Error") 32 | { 33 | VsShellUtilities.ShowMessageBox( 34 | _serviceProvider, 35 | $"{ex.Message}\n{ex.StackTrace}", 36 | title, 37 | OLEMSGICON.OLEMSGICON_CRITICAL, 38 | OLEMSGBUTTON.OLEMSGBUTTON_OK, 39 | OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST); 40 | } 41 | 42 | public void ShowInfoMessage(string message, string title = "") 43 | { 44 | VsShellUtilities.ShowMessageBox( 45 | _serviceProvider, 46 | message, 47 | title, 48 | OLEMSGICON.OLEMSGICON_INFO, 49 | OLEMSGBUTTON.OLEMSGBUTTON_OK, 50 | OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/VSIX/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/RenameProjectVs2015Extension/RenameProjectVs2015Extension/Helpers/DteSolutionHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Microsoft.VisualStudio.Shell; 3 | using EnvDTE; 4 | using EnvDTE80; 5 | 6 | namespace RenameProjectVs2015Extension.Helpers 7 | { 8 | internal class DteSolutionHelper 9 | { 10 | public DTE2 GetDte() 11 | { 12 | return Package.GetGlobalService(typeof(DTE)) as DTE2; 13 | } 14 | 15 | public Project GetSelectedProject() 16 | { 17 | var dte = GetDte(); 18 | if (dte.SelectedItems.Count == 0) 19 | return null; 20 | 21 | return dte.SelectedItems.Item(1).Project; 22 | } 23 | 24 | public string GetSolutionFullName() 25 | { 26 | var dte = GetDte(); 27 | return dte.Solution.FullName; 28 | } 29 | 30 | public IEnumerable GetSolutionProjects() 31 | { 32 | var dte = GetDte(); 33 | 34 | var projects = new List(); 35 | for (int i = 1; i <= dte.Solution.Projects.Count; i++) 36 | { 37 | var project = dte.Solution.Projects.Item(i); 38 | FindProjects(projects, project); 39 | } 40 | 41 | return projects; 42 | } 43 | 44 | public void FindProjects(IList projects, Project project) 45 | { 46 | if (string.IsNullOrEmpty(project.FullName)) 47 | { 48 | for (int j = 1; j <= project.ProjectItems.Count; j++) 49 | { 50 | var projectItem = project.ProjectItems.Item(j); 51 | if (projectItem.SubProject != null) 52 | FindProjects(projects, projectItem.SubProject); 53 | } 54 | } 55 | else 56 | { 57 | projects.Add(project); 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/RenameProjectVs2015Extension/Core/SharedTypeProjectRenamer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Core 9 | { 10 | public class SharedTypeProjectRenamer : ProjectRenamer 11 | { 12 | public string ProjectItemsFileName => $"{this.ProjectName}.projitems"; 13 | public string ProjectItemsFileNameNew => $"{this.ProjectNameNew}.projitems"; 14 | 15 | public override void RenameAssemblyNameAndDefaultNamespace() 16 | { 17 | } 18 | 19 | public override void RenameAssemblyInformation() 20 | { 21 | } 22 | 23 | public override void CustomRenameForProjectType() 24 | { 25 | string projFileText = File.ReadAllText(ProjectFullNameNew); 26 | projFileText = projFileText.Replace(this.ProjectName, this.ProjectNameNew); 27 | FileManager.WriteAllText(ProjectFullNameNew, projFileText); 28 | 29 | var projectDirectory = ProjectFullNameNew.GetDirectoryName(); 30 | var projItemsFilePath = Path.Combine(projectDirectory, ProjectItemsFileName); 31 | if (File.Exists(projItemsFilePath)) 32 | { 33 | string assemblyInfoFileText = File.ReadAllText(projItemsFilePath); 34 | assemblyInfoFileText = assemblyInfoFileText 35 | .ReplaceWithTag(ProjectName, ProjectNameNew, "Import_RootNamespace"); 36 | FileManager.WriteAllText(projItemsFilePath, assemblyInfoFileText); 37 | } 38 | 39 | var fullNameWithRenamedFolder = 40 | Path.Combine(ProjectFullNameNew.GetDirectoryName(), ProjectItemsFileName); 41 | var fullNameWithRenamedFolderNew = 42 | Path.Combine(ProjectFullNameNew.GetDirectoryName(), ProjectItemsFileNameNew); 43 | FileManager.Move(fullNameWithRenamedFolder, fullNameWithRenamedFolderNew); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/Core/SharedTypeProjectRenamer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Core 9 | { 10 | public class SharedTypeProjectRenamer : ProjectRenamer 11 | { 12 | public string ProjectItemsFileName => $"{this.ProjectName}.projitems"; 13 | public string ProjectItemsFileNameNew => $"{this.ProjectNameNew}.projitems"; 14 | 15 | public override void RenameAssemblyNameAndDefaultNamespace() 16 | { 17 | } 18 | 19 | public override void RenameAssemblyInformation() 20 | { 21 | } 22 | 23 | public override void CustomRenameForEachProjectType() 24 | { 25 | string projFileText = File.ReadAllText(ProjectFullNameNew); 26 | projFileText = projFileText.Replace(this.ProjectName, this.ProjectNameNew); 27 | FileManager.WriteAllText(ProjectFullNameNew, projFileText); 28 | 29 | var projectDirectory = ProjectFullNameNew.GetDirectoryName(); 30 | var projItemsFilePath = Path.Combine(projectDirectory, ProjectItemsFileName); 31 | if (File.Exists(projItemsFilePath)) 32 | { 33 | string assemblyInfoFileText = File.ReadAllText(projItemsFilePath); 34 | assemblyInfoFileText = assemblyInfoFileText 35 | .ReplaceWithTag(ProjectName, ProjectNameNew, "Import_RootNamespace"); 36 | FileManager.WriteAllText(projItemsFilePath, assemblyInfoFileText); 37 | } 38 | 39 | var fullNameWithRenamedFolder = 40 | Path.Combine(ProjectFullNameNew.GetDirectoryName(), ProjectItemsFileName); 41 | var fullNameWithRenamedFolderNew = 42 | Path.Combine(ProjectFullNameNew.GetDirectoryName(), ProjectItemsFileNameNew); 43 | FileManager.Move(fullNameWithRenamedFolder, fullNameWithRenamedFolderNew); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/RenameProjectVsExtension/VSIX/FullRenameDialog.xaml: -------------------------------------------------------------------------------- 1 | 12 | 13 |