About C # reflection Assembly.Load (). CreateInstance () No error, return object is empty

Source: Internet
Author: User

Starting a new project these days, the problem with the Abstractdalfactory reflection instance is that the load assembly succeeds, but the create instance is null.

The reflected assembly name and namespace are s2s. Dal,

At first I was wondering if there was a point in the middle. Question, in turn think impossible, because I autofac rely on inject S2s.bll object when, in the middle also some point.

The first night was debugged for a few hours, and after a few hours of debugging tonight, I finally decided to recreate a Dal assembly, named S2s_dal.

Sure enough, the problem is solved.

According to the situation, it is. NETFramework's judgment was affected, and I guess AUTOFAC automatically identified the middle for us.

The conclusion remains to be verified.

As for why there is no full dependency injection, because I configured both layers with dependency injection failure, still in the study.

About C # reflection Assembly.Load (). CreateInstance () No error, return object is empty

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.