Today wrote a C # small test program, the first use of the default name WindowsFormsApplication2, after writing that the name is not good-looking, so want to change a name, but tried, want to complete the renaming is quite complicated, not only to change the solution name, project name, Also change the namespace name and folder name. The order is as follows:
1. VS2010 Right-click Rename on Solution Name
2. Rename right-click on project name
The above two steps are very obvious.
After the change, the effect is as follows
4. Next to rename the namespace name in the code, open a program file, find the name of the namespace, get rid of the error will appear, click on the small red box, choose Automatic Renaming:
Click on the Little Red box:
The namespace of the program files that already exist in all projects is renamed and completed automatically.
4. Next, change the default namespace name in the project properties so that the namespace name is correct after you create the new program file. Right-click Property on the project name to change the name:
5. Next, modify the name of the local folder where the project resides. Because VS2010 does not automatically modify the folder name. First close the VS2010. Then open the solution file with Notepad:
When open, modify the following:
Then go to rename the project folder:
If you want to rename a folder, this step is critical, if you do not do so, the error folder naming failed.
6. Next open the solution and modify the contents of the project AssemblyInfo.cs file:
7. At this point, the complete rename is completed.