Registering COM referenced DLLs on a build server

前端 未结 4 1840
不思量自难忘°
不思量自难忘° 2020-12-14 02:53

We\'re developing a C# application that references a few COM libraries (AutoIT for example).

I am including all referenced components under source control, in a 3rd

4条回答
  •  渐次进展
    2020-12-14 03:44

    For my original answer to a similar question see: TFS Build server and COM references - does this work?

    A better option for build servers may be to use the COMFileReference item in your project file instead of COMReference. An example would look like this:

    
       
         True
       
    
    

    The COM dll doesn't need to be registered on the machine for this to work.

    Each COMFileReference item can also have a WrapperTool attribute but the default seems to work fine. The EmbedInteropTypes attribute is not documented as being applicable to COMFileReference, but it seems to work as intended.

    See https://docs.microsoft.com/en-ca/visualstudio/msbuild/common-msbuild-project-items#comfilereference for a little more detail. This MSBuild item has been available since .NET 3.5.

提交回复
热议问题