Bug 2946 - ComVisible should be enabled by default
Summary: ComVisible should be enabled by default
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Interop ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-01-17 16:11 UTC by Alistair Leslie-Hughes
Modified: 2012-03-27 22:22 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Patch (911 bytes, patch)
2012-01-17 16:11 UTC, Alistair Leslie-Hughes
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Alistair Leslie-Hughes 2012-01-17 16:11:56 UTC
Created attachment 1217 [details]
Patch

If the ComVisible attribute is not set then the class should be available via the IDispatch Interface.

Info about the default can be found here.
http://msdn.microsoft.com/en-us/library/ms182157%28v=vs.80%29.aspx
Comment 1 Jonathan Chambers 2012-01-19 09:54:04 UTC
This patch looks ok. I think the code is only hit when trying to marshal a managed object into native code. 

cominterop_com_visible will probably need updated to look at assembly for attribute in addition to jus the klass.

Do you have a use case for this? Note that all the IDispatch related functionality is currently not implemented and will return E_NOTIMPL.
Comment 2 Alistair Leslie-Hughes 2012-01-19 14:53:49 UTC
Yes, it will only be hit when it being marshaled.

>cominterop_com_visible will probably need updated to look at assembly for
>attribute in addition to jus the klass.
Can you give me more details on this?

The test was, an application under WINE creates a .NET object failed when the ComVisible wasn't set.
Comment 3 Alistair Leslie-Hughes 2012-01-23 04:33:21 UTC
What other modifiations need to be done? or how do I get my patch into the main repository?
Comment 4 Jonathan Chambers 2012-01-23 13:59:34 UTC
Give me a day or two to write some tests for this in the runtime tests, and I will apply your patch.
Comment 5 Alistair Leslie-Hughes 2012-03-25 06:00:15 UTC
Any Update?
Comment 6 Jonathan Chambers 2012-03-27 21:55:49 UTC
Committed at 09c1aa8bf9. Thanks.