[Tip] DOTNET project add reference

Source: Internet
Author: User
Tags dotnet
We are so used to adding DOTNET module references and project references, but rarely meet situations requiring adding other DOTNET module directly. The other DOTNET module consists of 3 kinds:
-- Precondition of installing my app. Like installing a ACAD addin app requires ACAD to be there as precondition. So refering to ACAD modules requires not adding
The referred DLLs adding into my app installer.
-- My app's 3rd party library. My app installer shocould make sure deploying required modules into user machine.

-- My app's component modules. np here ..

The question is: how to add a local-directory dependent DOTNET module as reference and can still keep this project compiled successfully and deployed successfully?

Well, to answer it, we need to understand:

1. How dotnet clr locates a assembly at runtime.

Firstly, it totally has no relationship with the local directory you specified in the vs project for adding reference. in my understanding, building the DOTNET project will embed its dependent assmemblies into its manifest file while it doesn't contain where to find it and its Platform (x32/x64) info. when at runtime, CLR will follow its locating Rule and Its platform version to find and load required assembly. I didn't read enough. so still put articles below for further reading:

Http://msdn.microsoft.com/en-us/library/yx7xezcf.aspx

Http://support.microsoft.com/kb/837908#appliesto

Http://msdn.microsoft.com/en-us/library/4191fzwb.aspx

And twoBooks:

A. Don box's "essential DOTNET"

B. And Steven pratschner's "customzing the Microsoft. NET Framework CLR"

Which has detailed description on. NET Runtime's assembly binding andloading.

2. What about CLR's handling of x32/x64 in loading assembly for DOTNET application?

Not ready more yet... need further reading.

3. What's the correct way to add reference about a separate dotnet dll living in a local directory?

You need to add $ (XX) --- environment variable into project file manually instead of using vs to specify the local path so that on the build machine and other's machine, as we share the same set of environment variables, so in this way, the project building can be no problem; while it has no relationship with the deployment of the refered DOTNET modules.

Refer to: http://blog.csdn.net/ham235/archive/2010/08/09/5800073.aspx

Coming here, it's resolved.

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.