C# ActiveX Control won't load on some machines, does on others

A

Artie

Hi,

Our team have a web project which includes some C# ActiveX DLLs.

On some developers' PCs, the code which calls methods in the ActiveX
dll is succesful - no exceptions. On other PCs, the ActiveX control
doesn't even seem to get loaded. (On the failing machines, if we try
and debug down to where the ActiveX DLL method is invoked, both Visual
Studio
and IE hang.)

So there seems to be inconsistencies between the environment on the
different PCs which either does or doesn't allow the DLL to run, or
get registered, or have the right permissions.

My question is, what in the environment configuration can affect
whether an ActiveX DLL can load or not?

Thanks in advance

Artie
 
G

Guest

Could we explain the definitions first? What *IS* a "C# ActiveX control",
specifically?
Peter
 
A

Artie

Could we explain the definitions first? What *IS* a "C# ActiveX control",
specifically?
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net











- Show quoted text -

It's a control we've written in C# that gets built as an ActiveX DLL.

It resides in a folder called ActiveX which is below the root of our
IIS site.
The relevant piece ASP code refers to the dll as follows:

<object id="testID" style="display:none;" classid="/ActiveX/
Test.ActiveX.dll#Test.ActiveX.Processors.Processor"></object>

The web app works fine on some machines, but doesn't on others - the
DLL doesn't get loaded.

We've eliminated XP Service Packs, Hotfixes, IE versions etc as being
the cause. We've put various users in the Administrators group, and
ensured all folders have read/write access.

We think it's got something to do with permissions, but we don't know.

Any help would be much appreciated.

Artie
 
A

Artie

OK, that's not an "ActiveXControl"; there is no COM involved. What you have
is a .Net UserControl that you want to host in Internet Explorer. And yes,
there are security issues involved. Specifically, try settings in the .NET
Configuration wizards in Control Panel. At a minimum, you would need to grant
Full Trust to the url.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net













- Show quoted text -

Peter,

Thanks for the clarification over the control type.

I followed your suggestion re the .NET config wizards (in
Administrative Tools), but these actions had no effect - we're still
getting the DLL loading on some machines and not others.

I did the following:

Adjusted .NET Security to Full Trust
Added the URL to Trusted Sites, and gave that Full Trust
Trusted the Assembly itself
I've checked the dependencies for the dll on the PC and they're all
fine too.

I should mention that I've tried accessing the site (and therefore
trying to invoke the dll on the web server) from IE5.5, IE6 and
IE6SP2, all with the same results, so it's definitely a server-side
config/security issue.

We do have other (non .NET) server-side DLLs that seem to work without
any problems on every machine.

Any other thoughts? Any IIS 5.1 peculiarities that typically catch
folk out?

Artie
 
A

Alvin Bruney [MVP]

Firstly, you need to determine if your issue is related to CAS policy. Turn
CAS policy off on the machine, purge the assembly download cache, close IE
and re-open to the URL. If your control doesn't load, this is not a CAS
policy issue. If your control loads, turn CAS policy back on and add
full_trust to the all_code group. This is a required work-around to a CAS
design flaw.

Follow that by adding a custom code group and configure permissions for the
control. See this link: http://support.microsoft.com/kb/555688

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley


Artie said:
OK, that's not an "ActiveXControl"; there is no COM involved. What you
have
is a .Net UserControl that you want to host in Internet Explorer. And
yes,
there are security issues involved. Specifically, try settings in the
.NET
Configuration wizards in Control Panel. At a minimum, you would need to
grant
Full Trust to the url.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net



Artie said:
On 2 Mar, 22:58, Peter Bromberg [C# MVP]
Could we explain the definitions first? What *IS* a
"C#ActiveXcontrol",
specifically?
Peter
Our team have a web project which includes some C#ActiveXDLLs.
On some developers' PCs, the code which calls methods in theActiveX
dll is succesful - no exceptions. On other PCs, theActiveXcontrol
doesn't even seem to get loaded. (On the failing machines, if we
try
and debug down to where theActiveXDLL method is invoked, both
Visual
Studio
and IE hang.)
So there seems to be inconsistencies between the environment on the
different PCs which either does or doesn't allow the DLL to run, or
get registered, or have the right permissions.
My question is, what in the environment configuration can affect
whether anActiveXDLL can load or not?
Thanks in advance
Artie- Hide quoted text -
- Show quoted text -
It's a control we've written in C# that gets built as anActiveXDLL.
It resides in a folder calledActiveXwhich is below the root of our
IIS site.
The relevant piece ASP code refers to the dll as follows:
<object id="testID" style="display:none;" classid="/ActiveX/
Test.ActiveX.dll#Test.ActiveX.Processors.Processor"></object>
The web app works fine on some machines, but doesn't on others - the
DLL doesn't get loaded.
We've eliminated XP Service Packs, Hotfixes, IE versions etc as being
the cause. We've put various users in the Administrators group, and
ensured all folders have read/write access.
We think it's got something to do with permissions, but we don't know.
Any help would be much appreciated.
Artie- Hide quoted text -

- Show quoted text -

Peter,

Thanks for the clarification over the control type.

I followed your suggestion re the .NET config wizards (in
Administrative Tools), but these actions had no effect - we're still
getting the DLL loading on some machines and not others.

I did the following:

Adjusted .NET Security to Full Trust
Added the URL to Trusted Sites, and gave that Full Trust
Trusted the Assembly itself
I've checked the dependencies for the dll on the PC and they're all
fine too.

I should mention that I've tried accessing the site (and therefore
trying to invoke the dll on the web server) from IE5.5, IE6 and
IE6SP2, all with the same results, so it's definitely a server-side
config/security issue.

We do have other (non .NET) server-side DLLs that seem to work without
any problems on every machine.

Any other thoughts? Any IIS 5.1 peculiarities that typically catch
folk out?

Artie
 
A

Artie

Firstly, you need to determine if your issue is related to CAS policy. Turn
CAS policy off on the machine, purge the assembly download cache, close IE
and re-open to the URL. If your control doesn't load, this is not a CAS
policy issue. If your control loads, turn CAS policy back on and add
full_trust to the all_code group. This is a required work-around to a CAS
design flaw.

Follow that by adding a custom code group and configure permissions for the
control. See this link:http://support.microsoft.com/kb/555688

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon andwww.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley




OK, that's not an "ActiveXControl"; there is no COM involved. What you
have
is a .Net UserControl that you want to host in Internet Explorer. And
yes,
there are security issues involved. Specifically, try settings in the
.NET
Configuration wizards in Control Panel. At a minimum, you would need to
grant
Full Trust to the url.
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
:
On 2 Mar, 22:58, Peter Bromberg [C# MVP]
Could we explain the definitions first? What *IS* a
"C#ActiveXcontrol",
specifically?
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
:
Hi,
Our team have a web project which includes some C#ActiveXDLLs.
On some developers' PCs, the code which calls methods in theActiveX
dll is succesful - no exceptions. On other PCs, theActiveXcontrol
doesn't even seem to get loaded. (On the failing machines, if we
try
and debug down to where theActiveXDLL method is invoked, both
Visual
Studio
and IE hang.)
So there seems to be inconsistencies between the environment on the
different PCs which either does or doesn't allow the DLL to run, or
get registered, or have the right permissions.
My question is, what in the environment configuration can affect
whether anActiveXDLL can load or not?
Thanks in advance
Artie- Hide quoted text -
- Show quoted text -
It's a control we've written in C# that gets built as anActiveXDLL.
It resides in a folder calledActiveXwhich is below the root of our
IIS site.
The relevant piece ASP code refers to the dll as follows:
<object id="testID" style="display:none;" classid="/ActiveX/
Test.ActiveX.dll#Test.ActiveX.Processors.Processor"></object>
The web app works fine on some machines, but doesn't on others - the
DLL doesn't get loaded.
We've eliminated XP Service Packs, Hotfixes, IE versions etc as being
the cause. We've put various users in the Administrators group, and
ensured all folders have read/write access.
We think it's got something to do with permissions, but we don't know.
Any help would be much appreciated.
Artie- Hide quoted text -
- Show quoted text -

Thanks for the clarification over the control type.
I followed your suggestion re the .NET config wizards (in
Administrative Tools), but these actions had no effect - we're still
getting the DLL loading on some machines and not others.
I did the following:
Adjusted .NET Security to Full Trust
Added the URL to Trusted Sites, and gave that Full Trust
Trusted the Assembly itself
I've checked the dependencies for the dll on the PC and they're all
fine too.
I should mention that I've tried accessing the site (and therefore
trying to invoke the dll on the web server) from IE5.5, IE6 and
IE6SP2, all with the same results, so it's definitely a server-side
config/security issue.
We do have other (non .NET) server-side DLLs that seem to work without
any problems on every machine.
Any other thoughts? Any IIS 5.1 peculiarities that typically catch
folk out?
Artie- Hide quoted text -

- Show quoted text -

Thanks for your suggestion Alvin.

I turned off CAS policy, cleared the assembly cache, closed IE, and
restart the web app. Same issue - control didn't load.

I also glanced through a couple of your articles, but couldn't see
anything obvious.

Anything else you can think of?

Artie
 
G

Guest

This sounds like a similar problem to what we are having also...

ActiveX runs ok on some PCs with Windows XP and IE7 and not on others?

We have found that if the activeX was installed prior to the IE7 update then
our activeX runs perfectly and we can also detect the version (important for
updates). But if the activeX is installed after updating to IE7 then the
activeX is not run. Nor can it be detected and it doesn't show in "managed
add-ons".

At the moment we are trying to find out how it can be installed and accepted
as a "Managed add-on" in IE7. Web searches have turned up a lot of discussion
about not be able to detect plugin/version in IE7 at all, and wondering how
other developers are coping?

- Is there a solution?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top