[Tip]dotNet project Add Reference
2010-09-30 15:30
387 查看
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 should 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 two books:
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.
--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 should 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 two books:
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.
相关文章推荐
- [tip]view dotnet assembly resources
- 和matlab开发应用有关的网址http://www.codeproject.com/dotnet/matlabeng.asp
- Add Project Reference vs Add DLL Reference
- Your project is not referencing the ".NETPortable,Version=v4.5,Profile=Profile259" framework. Add a reference to ".NETPortable,Version=v4.5,Profile=Profile259" in the "frameworks" section of your proj
- Add Project Reference vs Add DLL Reference
- VS .NET add web reference
- http://www.codeproject.com/dotnet/vbnet_c__difference.asp
- Steps to Create Setup and Deployment Project in Dot Net VS 2008
- .net 垃圾回收学习[http://www.codeproject.com/KB/dotnet/idisposable.aspx][翻译&&学习][2]
- .net 垃圾回收学习[http://www.codeproject.com/KB/dotnet/idisposable.aspx][翻译&&学习][2]
- [Tip: project reference]Project Reference In VS
- .net 垃圾回收学习[http://www.codeproject.com/KB/dotnet/idisposable.aspx][翻译&&学习][2]
- Querying Active Directory using .NET classes and LDAP queries(http://www.codeproject.com/dotnet/activedirquery.asp)
- NU1002 The dependency Microsoft.AspNet.Mvc 5.2.3 in project dotnetstarter does not support framework
- ASP.NET Core: You must add a reference to assembly mscorlib, version=4.0.0.0
- [Tip: dotNet collection]Dictionary Data Sequence
- Error 1 Project file must include the .NET Framework assembly 'PresentationCore, PresentationFramework' in the reference
- http://www.codeproject.com/dotnet/WWF.asp#xx1331348xx
- dotNet weakReference
- DNN建站还原报(DotNetNuke Error - Windows Server 2003 - Return to Site)错怎么办?