comvisible

warning MSB3391: <DLL> does not contain any types that can be unregistered for COM Interop

你。 提交于 2019-12-19 05:22:08
问题 I've made a simple C# DLL (that's part of a much larger project) using VS2005. I need to use the DLL in Excel via VBA code so I am using COM Interop on the assembly. I am trying to make the build process automatically generate the necessary TLB file so that I don't need to go to the command line and use regasm after every build. My problem is that although the DLL compiles and builds fine, it does not generate a TLB file. Instead, the error in the title prints out in the output box. I've

Class not registered error from PHP

匆匆过客 提交于 2019-12-10 17:17:49
问题 We've created a C# class library assembly and made it COM visible to be able to call its methods from PHP. This used to work fine, but now we wanted to install it on a Windows Server 2008 server and we keep walking into the error "Class not registered". To rule out any dependency problems I made a tiny little test class library in C#. The class library is built for Any CPU and it is COM visible (also set COMVisible to true in AssemblyInfo.cs). The test class library only contains one class

ComVisible in C++/CLI

故事扮演 提交于 2019-12-09 12:04:50
问题 i'm converting C++ to C++/CLI and would like to expose some managed classes as COM objects. In C# it was easy and setting [ComVisible] & inheriting from interface (also ComVisible) did the job. However C++ project build as C++/CLI does not export DllRegisterServer. Here is sample project (started from CLR Console Application project in VS 2008). #include "stdafx.h" using namespace System; using namespace System::Runtime::InteropServices; [ComVisible(true)] [Guid("E3CF8A18-E4A0-4bc3-894E

warning MSB3391: <DLL> does not contain any types that can be unregistered for COM Interop

不问归期 提交于 2019-12-01 03:44:57
I've made a simple C# DLL (that's part of a much larger project) using VS2005. I need to use the DLL in Excel via VBA code so I am using COM Interop on the assembly. I am trying to make the build process automatically generate the necessary TLB file so that I don't need to go to the command line and use regasm after every build. My problem is that although the DLL compiles and builds fine, it does not generate a TLB file. Instead, the error in the title prints out in the output box. I've gotten other DLLs to build TLB files by going to the project's properties in VS2005 -> Build -> Output ->

What's the deal with [ComVisible] default and public classes COM exposure?

南笙酒味 提交于 2019-11-30 04:30:36
MSDN has this article about [ComVisible] attribute . I don't quite get what happens when one sets [ComVisible(true)] . MSDN says The default is true , which indicates that the managed type is visible to COM. This attribute is not needed to make public managed assemblies and types visible ; they are visible to COM by default. Only public types can be made visible. So they say public types are visible to COM by default. But they also say only public types can be made visible by setting [ComVisible(true)] . It does not makes sense: if public types are visible by default, then how does setting

What's the deal with [ComVisible] default and public classes COM exposure?

こ雲淡風輕ζ 提交于 2019-11-29 01:44:58
问题 MSDN has this article about [ComVisible] attribute. I don't quite get what happens when one sets [ComVisible(true)] . MSDN says The default is true , which indicates that the managed type is visible to COM. This attribute is not needed to make public managed assemblies and types visible ; they are visible to COM by default. Only public types can be made visible. So they say public types are visible to COM by default. But they also say only public types can be made visible by setting

Is there any point in specifying a Guid when using ComVisible(false)?

懵懂的女人 提交于 2019-11-28 22:25:37
When you create a new C# project in Visual Studio, the generated AssemblyInfo.cs file includes an attribute specifying an assembly GUID. The comment above the attribute states that it is used "if this project is exposed to COM". None of my assemblies contain types which need to be visible to COM, so I have marked my assembly with [assembly: ComVisible(false)] . So is there any point in specifying a GUID? My feeling is that the answer is "no" - so why does the default AssemblyInfo.cs file contain both [assembly: ComVisible(false)] and [assembly: Guid("...")] ? Edit: To summarize the responses:

Is it possible to implement a COM interface with a .NET generics class?

两盒软妹~` 提交于 2019-11-28 12:12:20
I have the following interface which I'm trying to make COM-visible. When I try to generate the type-library it doesn't like the fact that my implementation class derives from a generic-class. Is it possible to use a generic class as a COM implementation class? (I know I could write a non-generic wrapper and export that to COM, but this adds another layer that I'd rather do without.) [ComVisible(true)] public interface IMyClass { ... } [ComVisible(true), ComDefaultInterface(typeof(IMyClass))] [ClassInterface(ClassInterfaceType.None)] public class MyClass : BaseClass<IMyClass>, IMyClass { ... }

RegAsm - When is the /codebase option applicable?

梦想与她 提交于 2019-11-27 17:37:20
问题 I have a COM-visible DLL written in C# that I would like to use in a VB6 application. I have two main use cases of the DLL and am wondering when the /codebase option is applicable and when it is better to register in the GAC. Use cases: The DLL will be loaded onto another developers PC and needs to be accessible to the VB6 IDE under the Project > References menu The DLL will be loaded onto production machines when the VB6 application is released Any information on the appropriate use of the

Is there any point in specifying a Guid when using ComVisible(false)?

无人久伴 提交于 2019-11-27 14:20:06
问题 When you create a new C# project in Visual Studio, the generated AssemblyInfo.cs file includes an attribute specifying an assembly GUID. The comment above the attribute states that it is used "if this project is exposed to COM". None of my assemblies contain types which need to be visible to COM, so I have marked my assembly with [assembly: ComVisible(false)] . So is there any point in specifying a GUID? My feeling is that the answer is "no" - so why does the default AssemblyInfo.cs file