The type or namespace cannot be found, and whether the reference is missing -- rename the class library name in the existing project, class name considerations

Source: Internet
Author: User

I. Rename the Class Library:

1: Right-click, click Properties, modify Assembly name, and default space name

2. Right-click the class library and rename it.

3. Open assemblyinfo. CS and modify the name.

4. If there are folders under the class library and classes in the folder, modify the namespace of all classes.

5. generate a new one and rereference it.

Open the name of userinfo. CS in models under shanglin.

 Namespace shanglin. Models
{
Public class userinfo
{
}
}

 

Ii. Modify the Class Name:

1. Right click, properties, and change the file name to the class name to be modified.

2. Open the class file, modify the namespace, and change models to the class name to be modified.

3. generate a new one and rereference it.

 Namespace shanglin. Models
{
Public class userinfo
{
}
}

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.