Problem Isolating Com Reference?

R

ralpugan

Hi,
As you may know, we can isolate a COM object by setting its
reference's Isolated property to "True" in Visual Studio to eliminate
requirement of registration of COM component to make it registration-
free. But as i've tried on .NET 2.0 with VS 2005 and on .NET 3.5 with
VS 2008, when i try to isolate an OCX (that OCX is used to play mp3s),
i get warning in error list during compilation saying:

"Warning Problem isolating COM reference 'PlayMP3': Registry key
'HKEY_CLASSES_ROOT\CLSID\{80b19c85-
fb86-11d4-9eaf-00e07d8de751}\Implemented Categories
\{0DE86A52-2BAA-11CF-A229-00AA003D7352}' was not imported."

Though that "warning", compilation is successful and it seems that
manifest file seems generated fine and can run without registration on
target machine as expected.

However, i wonder why VS emits that "warning" message? Is there any
special behaviour for OCX files when trying to make them registration-
free?

Note: If you re-compile or debug project in VS, warning goes away and
when you make any change on project, it appears on next compilation
again. And the OCX is registered on development machine which
shouldn't be the reason.

I looked at Google and only these links on that page seems relevant,
but there's no solid solution.
http://social.msdn.microsoft.com/Fo.../thread/e030966a-03e2-49a1-9775-48f7b5e1c7c6/

Just wonder the reason of that warning.

Thanks...

Expert
 
T

Tom Shelton

Hi,
As you may know, we can isolate a COM object by setting its
reference's Isolated property to "True" in Visual Studio to eliminate
requirement of registration of COM component to make it registration-
free. But as i've tried on .NET 2.0 with VS 2005 and on .NET 3.5 with
VS 2008, when i try to isolate an OCX (that OCX is used to play mp3s),

I've not used reg free com - so, can't answer that question - but, if you
using .NET 3.5, is there some reason you can't use the built in
System.Windows.Media.MediaPlayer class to play your mp3? Just a thought...
 
R

ralpugan

I've not used reg free com - so, can't answer that question - but, if you
using .NET 3.5, is there some reason you can't use the built in
System.Windows.Media.MediaPlayer class to play your mp3? Just a thought...

Hi Tom,
Thanks for your suggestion, however the issue is not playing mp3s. The
OCX can be another object that'll be used for other purposes in future
such as CD burning OCX or charting OCX etc..., depending on the
requirement of project. The issue is why that warning appears when i
try to isolate an OCX which is an COM object. The interesting part is
that though VS Studio emits that warning, manifest file is generated
fine as desired. As i've digged into Google, i couldn't find any
useful info or article on MSDN or Microsoft's support site.

Reproducing issue is straight forward:
1-Add an OCX to your toolbox by using "Choose Items..." then browse
under "Com Components" tab . You can use that one for example:
http://www.vbcodesource.info/downloads/mp3playocx.zip
2-Place it on your form to instantiate.
3-Expand references folder, set AxPlayMp3's "Isolated" property to
"True" of that object.

4- Finally, click on "start debugging" button to compile and debug
project. On VS 2005 you'll see about 5 warnings (or many depending on
Com object) during compilation and you'll see the same warnings in VS
2008 after you exit the program in Error List saying:

"Warning 1 Problem isolating COM reference 'PlayMP3': Registry key
'HKEY_CLASSES_ROOT\CLSID\{80b19c85-
fb86-11d4-9eaf-00e07d8de751}\Implemented Categories
\{0DE86A52-2BAA-11CF-A229-00AA003D7352}' was not imported.
WindowsApplication1" and so forth.

That's frustrating and finding no info about it is unclear.

In my logic, at first, Visual Studio insists on searching a fixed
registry location to gather required metadata, but then it finds the
true path by self-trial then manifest is generated fine. But it's just
a guess of course. And i beleive it's one of the most important thing
that should be fixed or explained in future for Visual Studio
(including Express editions), especially about the mystery of
isolation of OCX files to make them registration-free.

Thanks,

ralpugan
 
O

Onur Güzel

Hi,
As you may know, we can isolate a COM object by setting itsreference'sIsolated property to "True" in Visual Studio to eliminate
requirement of registration of COM component to make it registration-
free. But as i've tried on .NET 2.0 with VS 2005 and on .NET 3.5 with
VS 2008, when i try to isolate an OCX (that OCX is used to play mp3s),
i get warning in error list during compilation saying:

"WarningProblemisolatingCOMreference'PlayMP3': Registry key
'HKEY_CLASSES_ROOT\CLSID\{80b19c85-
fb86-11d4-9eaf-00e07d8de751}\Implemented Categories
\{0DE86A52-2BAA-11CF-A229-00AA003D7352}' was not imported."

Though that "warning", compilation is successful and it seems that
manifest file seems generated fine and can run without registration on
target machine as expected.

However, i wonder why VS emits that "warning" message? Is there any
special behaviour for OCX files when trying to make them registration-
free?

Note: If you re-compile or debug project in VS, warning goes away and
when you make any change on project, it appears on next compilation
again. And the OCX is registered on development machine which
shouldn't be the reason.

I looked at Google and only these links on that page seems relevant,
but there's no solid solution.http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvb/thread/e030...

Just wonder the reason of that warning.

Thanks...

Expert

Hi,
I have the "same" issue. Whenever i set an COM OCX as "Isolated=True"
through references, i get about 4 or 5 warnings during compilation,
though manifest file gets generated fine. I think it's still a bug or
misdesign or inconsistency in Visual Studio (had same in 2005 and 2008
SP1), because VS seems to search a fixed registy location as stated on
the link(s) you've posted.

PS: Registering OCX manually doesn't let warning go away(it's a
requirement anyway), however OCX runs OK on compiled application
without registration, and the internet or Microsoft doesn't provide
any article(s) about this warning whether it's safe to ignore or not.

Onur Güzel
 
Top