472,811 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,811 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 2018
> 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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?

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.