English 中文(简体)
参考COM+, 不同用途
原标题:Reference COM+ from .Net with varying GUID

We have a project that references COM+ components (written in VB6). The components are added to our .Net solution by Add reference . This works well and even intellisense works.

现在和那时,各组成部分的接口(可比性)被打破,我们有。 净代码再行。 该构成部分加上一个专门的GUID,即GUID是再登记的。

The question: Is it possible to call the COM+ components in the same way as we are used to (no reflection allowed), without having to update the references in our .Net solution. For instance by creating a wrapper for the COM+ component on basis of filename?

Regards, M.

最佳回答

No., NET (以及任何本土方案)将无法在不知情权的情况下即刻播放COM部分。

最好的做法是防止这一构成部分在构成部分项目中首先转向binary兼容<>em>,并保持接口以保持兼容。 一旦中断接口,你就不得不读到你的节目中,以便找到新的有效参考资料。 这并不是因为......。 该网络是多余的,因为一旦你打破了接口,你就有必要对客户进行重组。

问题回答

当你提到一个COM物体时,视觉演播室自动为你创建了一个Interop。 这一互操作基本上是一个包裹的班子,负责装上COM标的,并载有电传功能的标语。

如果您的意向正在发生变化,你可以随时更新COM标语,或者可以生成Interop yourself。

你们可以利用拖拉皮条工具这样做:

TlbImp.exe "MyCOMClass.dll" /out:Interop.MyCOMClass.dll

现在,如果你只是提及Interop的话。 MyCOMClass.dll, 而不是COM物体, 那么,如果COM oject的改动,你就可以简单地将Interop与上述声明重新提出,并连同新的COM标本一并分发。





相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签