Questions tagged [comvisible]

50 questions
42
votes
3 answers

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

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…
user200783
  • 13,722
  • 12
  • 69
  • 135
37
votes
2 answers

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

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…
user2166888
  • 579
  • 1
  • 5
  • 13
20
votes
1 answer

RegAsm - When is the /codebase option applicable?

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…
davidk
  • 784
  • 1
  • 6
  • 22
12
votes
3 answers

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

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…
Rocky
9
votes
1 answer

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

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…
user3891
  • 9,101
  • 4
  • 24
  • 18
8
votes
1 answer

Is it possible to build a .NET DLL with COM visible types without VS requiring elevation?

An assembly in a project has a type marked with ComVisible(true). When building (non-elevated), VS tries to register that DLL and fails: Cannot register assembly "\path\to\foo.dll" - access denied. Please make sure you're running the application as…
Rik Hemsley
  • 877
  • 1
  • 10
  • 15
7
votes
1 answer

ComVisible in C++/CLI

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…
Petr Havlicek
  • 2,051
  • 1
  • 19
  • 25
5
votes
4 answers

ComVisible .NET assembly and app.config

I have .NET assembly with some classes marked as ComVisible This assembly is registered with regasm /codebase "assembly_path" I have app.config name (actually - MyAssemblyName.dll.config) which are in assembly's folder I access to appSettings in my…
chopikadze
  • 4,219
  • 26
  • 30
4
votes
2 answers

C# ComVisible DLL only usable by IIS when Remote Desktop connected

I've created a ComVisible DLL which is signed with a given domain name (the company I work for). I place this DLL onto a customer's web host machine, which runs under a different domain, and register it using:…
Developer Webs
  • 983
  • 9
  • 29
4
votes
4 answers

Marshal.ReleaseComObject throws exception

Trying to use a COM visible .NET class via other .NET application and get exception: Message: The object's type must be __ComObject or derived from __ComObject. Parameter name: o Stack Trace: at …
Aaron
  • 2,236
  • 1
  • 16
  • 28
4
votes
2 answers

Exposing a .NET class (which has events) to COM

I want to expose a .NET class to COM. That's fairly easy: I create an interface in where I define the members of that class that should be ComVisible I define the DispId's of those members myself I define that the interface should be ComVisible I…
Frederik Gheysels
  • 56,135
  • 11
  • 101
  • 154
4
votes
2 answers

Class not registered error from PHP

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…
Ruben
  • 5,043
  • 2
  • 25
  • 49
3
votes
1 answer

ObjectForScripting with multiple Interfaces not working

I have a WinForm which interacts with a WebBrowserControl through the ObjectForScripting. The baseclass of my WinForm is not ComVisible and I can not or will not change it. Because there is a NonComVisibleBaseClass I have created an Interface and…
TurBas
  • 1,646
  • 13
  • 15
3
votes
2 answers

How to Instantiate a ComVisible Class into Its Own AppDomain in a Single-Threaded Client?

The Problem When instantiating two, independent .NET COM-visible classes within the same, single-threaded COM client, .NET loads them both into the same AppDomain. I am guessing that this is because they are being loaded into the same…
transistor1
  • 2,915
  • 26
  • 42
3
votes
1 answer

any possibility to call C# function with javascript?

I wrote an office addin and with which there is a function : openFile(String path) and in the office addin I embed a browser object and with that I can embed a webpage on the office addin, and now I hope I can call the C# function "openFile" and…
MemoryLeak
  • 7,322
  • 23
  • 90
  • 133
1
2 3 4