How to modify the project file name and namespace after the C # form project is established

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.