I am building a Setup Package using VS2008. This is a regular setup package installing a COM Add-In app for Outlook. It works Ok, so far. However I need to improve it a little...
我正在使用VS2008构建安装程序包。这是为Outlook安装COM加载项应用程序的常规安装程序包。到目前为止,它工作正常。但是我需要稍微改进一下......
The story is that installation package copies all dependent assemblies into the installation folder of the add-in.
故事是安装包将所有依赖程序集复制到加载项的安装文件夹中。
For example, the COM Add-In depends on Microsoft.Office.Interop.Outlook.dll assembly. So installation package copies it to its' folder :)
例如,COM加载项依赖于Microsoft.Office.Interop.Outlook.dll程序集。所以安装包将其复制到''文件夹:)
Of course, I can switch Exclude property of the Microsoft.Office.Interop.Outlook.dll dependency to True which will prevent the assembly from being copied. However, I need to achieve the following behavior:
当然,我可以将Microsoft.Office.Interop.Outlook.dll依赖项的Exclude属性切换为True,这将阻止程序集被复制。但是,我需要实现以下行为:
- In case Microsoft.Office.Interop.Outlook.dll is not in GAC, we simply copy it to the installation folder of the Add-In
- Otherwise, use the one which is in GAC
如果Microsoft.Office.Interop.Outlook.dll不在GAC中,我们只需将其复制到加载项的安装文件夹中
否则,请使用GAC中的那个
Please suggest the way ti can be done in .Net2.0? A step by step guide will be really appreciated.
请建议在.Net2.0中完成ti的方式?一步一步的指南将非常感激。
1 个解决方案
#1
Just always copy it to the folder. If it's already in the GAC, the GAC'd assembly will be used first anyway.
只需将其复制到文件夹即可。如果它已经在GAC中,则无论如何都将首先使用GAC的组件。
In other words the runtime checks the GAC first. Then, checks application base, etc.
换句话说,运行时首先检查GAC。然后,检查应用程序库等。
http://msdn.microsoft.com/en-us/library/yx7xezcf(VS.71).aspx
#1
Just always copy it to the folder. If it's already in the GAC, the GAC'd assembly will be used first anyway.
只需将其复制到文件夹即可。如果它已经在GAC中,则无论如何都将首先使用GAC的组件。
In other words the runtime checks the GAC first. Then, checks application base, etc.
换句话说,运行时首先检查GAC。然后,检查应用程序库等。
http://msdn.microsoft.com/en-us/library/yx7xezcf(VS.71).aspx