C # Instantiates an inherited class and must reference the assembly of the inherited class

Source: Internet
Author: User

0x00 Questions

The type "Model.newmodel" is defined in an unreferenced assembly. You must add a reference to the assembly "Model, version=1.0.0.0, Culture=neutral, Publickeytoken=null". C:\LF\UsingInherit\UsingInherit\Program.cs usinginherit\

origin of 0x01

  The approximate structure of the program is as follows:

The Newbll class under the BLL inherits the Newmodel class in model

And then in Usinginherit you want to instantiate the class NEWBLL, this happens.

After you add a reference to the model, you can compile the environment

0x02 Summary

  When instantiating a class of inheriting classes, instantiating an inheriting class, and inheriting a class that is not under the same assembly, in addition to referencing the assembly where the inheriting class resides, refer to the assembly where the inherited class resides!

In fact, whether this is because of the instantiation of the class, because there is no reference to the inherited class, it is not possible to inherit the properties of the class access, the specific principle is not very clear, find a lap did not find, back to learn to add the principle,

Hope to have an understanding of Bo friends can guide twos;

C # Instantiates an inherited class and must reference the assembly of the inherited class

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.