473,395 Members | 1,343 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,395 software developers and data experts.

Security issue running unmanaged code in a win form ctrl hosted in

Security problem running unmanaged code (.ocx control) in a windows from
control hosted in IE6

Hi,

I have design a windows from control which contain a .OCX in one of its
forms.
Component developed in C#2005 -------- .NET2

Now, the control is loaded successful via IIS in my web application. Now
when I try to load the form where the OCX is hosted:

private void button2_Click(object sender, EventArgs e)
{
Form1 a;
a = new Form1();
a.ShowDialog();
}

I got an .NET Excpetion saying:

System.Security.SecurityException: Request failed.
************** Exception Text **************
System.Security.SecurityException: Request failed.
at System.Windows.Forms.AxHost..ctor(String clsid, Int32 flags)
at System.Windows.Forms.AxHost..ctor(String clsid)
at AxAcroPDFLib.AxAcroPDF..ctor()
at WindowsControlLibrary1.Form1.InitializeComponent()
at WindowsControlLibrary1.Form1..ctor()
at WindowsControlLibrary1.UserControl1.button2_Click( Object sender,
EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
The action that failed was:
Demand
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.PermissionSet
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)

.......................

Now the permissions for the windows from control are set to unrestricted. (I
have Double-checked it via the framework evaluation permission option for
assemblies persent in .NET)

Tried the following in the AssemblyInfo.cs

[assembly: AllowPartiallyTrustedCallers()]
[assembly: SecurityPermissionAttribute(SecurityAction.Request Minimum, Flags
= SecurityPermissionFlag.UnmanagedCode)]
[assembly: SecurityPermissionAttribute(SecurityAction.Request Minimum, Flags
= SecurityPermissionFlag.ControlEvidence)]
[assembly: SecurityPermissionAttribute(SecurityAction.Request Minimum, Flags
= SecurityPermissionFlag.SkipVerification)]
[assembly: SecurityPermissionAttribute(SecurityAction.Request Minimum, Flags
= SecurityPermissionFlag.AllFlags)]
tried:

[SecurityPermission(SecurityAction.Assert, UnmanagedCode = true)]
[SecurityPermission(SecurityAction.Assert, ControlEvidence = true)]
[SecurityPermission(SecurityAction.Assert, Unrestricted = true)]
no luck!!!!
Any idea how to run unmanged code in a window from hosted in IE6?
Many Thanks,
Filippo
Mar 29 '06 #1
0 1060

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

Similar topics

5
by: Wescotte | last post by:
I'm currently working on desiging several web based applications that would be grouped into a larger web based menu system. However I'm not sure exactly how to go about making it as secure as...
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...
7
by: Tim Bücker | last post by:
Hello. I have written a little program that uses some unmanaged code - . I´ve send this program to a friend of mine and now he gets a security error. Two questions about that: 1) How can...
3
by: Nick Hodapp | last post by:
How can I supress runtime security checks in a mixed-mode C++ assembly? SuppressUnmanagedCodeSecurityAttribute apparently only works for P/Invoke and COM interop. I've got a somewhat chatty...
4
by: androoo | last post by:
Hi I have a windows control I embed onto an aspx page which is grabbing a dataset from the client and sending it to the server through a webservice. This works fine in a windows app. However...
5
by: Norsoft | last post by:
I have a .Net 1.1 application which is downloaded into an aspx page. It is a dll which inherits from System.Windows.Forms.UserControl. It works fine on a PC with only the 1.1 Framework. However,...
7
by: Magdelin | last post by:
Hi, My security team thinks allowing communication between the two IIS instances leads to severe security risks. Basically, we want to put our presentation tier on the perimeter network and the...
0
by: Filippo Bettinaglio | last post by:
Security problem running unmanaged code (.ocx control) in a windows from control hosted in IE6 Hi, I have design a windows from control which contain a .OCX in one of its forms....
3
by: Grant Schenck | last post by:
I have a simple remoting sample using IPCChannel. If I run the server code as a console app my client can connect just fine. However, if I the same server code runs in a service, the client gets...
7
by: mrmoosehead | last post by:
OK. I am trying to embed a control in a webpage that will allow local access to the TAPI system to make and query phone calls. In a nutshell. Anyway, I am aware that there are many security...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.