473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ActiveX control on a web page, Simulate Internet Security Zone?

Neo
I have a usercontrol that I am trying to use as an ActiveX Control on a
WebPage, however it refereneces an Assembly that whenever the first
call is made to anything in the Assembly a Security Exception is throw.
I am having a lot of trouble debugging this, because I cannot catch the
exception in my code.

However if I could run the control under the Internet Zone Security
settings I could probably find this easily. Does anyone know how to do
this? (The control runs fine in the ActiveX container)

Maybe I am not appoaching this the right way. What is the "right" way
to debug a .NET ActiveX control on a webpage?

Thanks in advance

Jul 21 '05 #1
3 2048
> I have a usercontrol that I am trying to use as an ActiveX Control on a
WebPage, however it refereneces an Assembly that whenever the first
call is made to anything in the Assembly a Security Exception is throw.
I am having a lot of trouble debugging this, because I cannot catch the
exception in my code.
Make sure the assembly has the following attribute:

[assembly: AllowPartiallyTrustedCallers()]

Maybe I am not appoaching this the right way. What is the "right" way
to debug a .NET ActiveX control on a webpage?
If you mean a Windows Form control hosted inside IE, what you need to do is
run IE, then run VS and Debug-Attach to Iexplorer.exe.

Prior to running IE you may want to clear your downloaded Cache to make sure
you are debugging the same version that is running, to do this do:

gacutil /cdl

Other than this, you just have to make sure you don't make calls to any API
that requires a special permission not available in the Internet Zone, what
I do a lot is I change my settings to allow Full-Trust in my Local Intranet,
then once I have it working, I lower the permissions, this way I can test
locally.

--
Francisco Padron
www.chartfx.com
"Neo" <ts******@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...I have a usercontrol that I am trying to use as an ActiveX Control on a
WebPage, however it refereneces an Assembly that whenever the first
call is made to anything in the Assembly a Security Exception is throw.
I am having a lot of trouble debugging this, because I cannot catch the
exception in my code.

However if I could run the control under the Internet Zone Security
settings I could probably find this easily. Does anyone know how to do
this? (The control runs fine in the ActiveX container)

Maybe I am not appoaching this the right way. What is the "right" way
to debug a .NET ActiveX control on a webpage?

Thanks in advance

Jul 21 '05 #2
Neo
Yep that fixed it right up thanks. Do you what the securty implications
of having this on all my Assemblies is?

Jul 21 '05 #3
This is what MSDN says:

Libraries that are private to a specific application do not require a strong
name or the AllowPartiallyTrustedCallersAttribute and cannot be referenced
by potentially malicious code outside the application. Such code is
protected against intentional or unintentional misuse by partially trusted
mobile code without the developer or administrator having to do anything
extra.

You should consider explicitly enabling use by partially trusted code for
the following types of code:

a.. Code that has been diligently tested for security vulnerabilities and
is in compliance with the guidelines described in Secure Coding Guidelines.
b.. Strong-named code libraries that are specifically written for
partially trusted scenarios.
c.. Any components (whether partially or fully trusted) signed with a
strong name that will be called by mobile code downloaded from the Internet
or the local intranet. These components are affected because under default
security policy mobile code receives partial trust.
d.. If default policy is modified, any code that security policy grants
less than full trust.
Note Some classes shipped in the .NET Framework class library do not
have the AllowPartiallyTrustedCallersAttribute and can't be called by
partially trusted code. See .NET Framework Assemblies Marked with
AllowPartiallyTrustedCallersAttribute for a list of classes that are
callable by partially trusted code.
The first point is key.

--
FP
Software FX
Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fie Fie Niles | last post by:
This one XP machine (with IE 6) is having a problem viewing any ActiveX controls (created on VB6) on the Internet Explorer browser. I put the same ActiveX control in a VB program, and when I run...
2
by: Steven Kobes | last post by:
I have an HTML file containing some JScript that creates a "WScript.Shell" ActiveX object. When it loads, Internet Explorer says: "An ActiveX control on this page might be unsafe to interact...
4
by: Greg Livengood | last post by:
I need to test my ASP.net web application for the case that the client browser doesn't support cookies or for the case that cookies are turned off on the client browswer. What is odd is that when...
11
by: John Boghossian | last post by:
I know this isnīt spot on for this group, but the problem relates to an asp.net project i am working on. I am trying to develop an windows forms control to be used in IE in an intranet solution....
3
by: EJ1003 | last post by:
Hello I would like to create Activex Control uisng C# and use it in ASP.Net webform. User Control is not solving my requirement so I am going for Activex Control. Please guide me on this, how...
3
by: Neo | last post by:
I have a usercontrol that I am trying to use as an ActiveX Control on a WebPage, however it refereneces an Assembly that whenever the first call is made to anything in the Assembly a Security...
5
by: fniles | last post by:
We created an ActiveX control and marked it as safe for scripting using Implements IObjectSafety. We then created a CAB file and signed it using Verisign. We also created a license file (LPK file)...
3
by: Peter | last post by:
ASP.NET 1.1 + IE I have the following code this.butCreateLetter.Attributes.Add("onClick", "return CreateLetter();"); This code Excecutes the following JScript function CreateLetter() {
6
by: Budhi Saputra Prasetya | last post by:
Hi All, I'm trying to display .NET Custom Control (created using Inherited Control) on an ASPX page, but no luck. I already registered the Control to Global Assembly Cache through .NET Framework...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.