Solve the problem that the type. GetType method in ASP. NET always returns NULL

Source: Internet
Author: User


Type. GetType always returns NULL;

Later, I checked the reference in the web project and found that there was a reference to the corresponding project ..

Therefore, the applicationProgramThe corresponding DLL cannot be found in the web project ..

Add a reference to solve the problem ....
Amount... I don't know how to make it better.
For example
For example, type. GetType ("system. String") // This is okay, because system. String is in mscorlib. dll.
Below I Want To Get myproject. Data. sqlserverdal
Type. GetType ("myproject. Data. sqlserverdal") // This write method is not valid. We need to specify the DLL file of its data.

Type. GetType ("myproject. Data. sqlserverdal, myproject. Data") // This is correct.

If the problem persists, another possibility is that myproject. Data is not referenced in the web project, so the DLL file cannot be found.
Add a new reference.

There are other solutions online

If the above steps cannot be solved, you can look at this

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.