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

Windows Forms Control Hosted in IE

Hi,

I have built a Windows Form Control which is hosted in IE (for our
Intranet). The form logs into a Web Service and retrieves information for
display. However, because the web service is on a different internal server,
we get the error message: "Error in document service. "Request for the
permission of type 'System.Net.WebPermission' failed". We have got this to
work on development machines by raising the trust level of the machine
hosting the webservice - but how do we do this for the clients on the rest
of the domain?

Has anyone seen this before... and if so, and more importantly... can you
suggest how to fix the problem?

We are running Framwework 2.0 and ASP.NET 2.0.

Thanks in advance,
James
Dec 8 '05 #1
5 1294
There are several options available for deploying CAS policy modifications
over a domain. See
http://msdn.microsoft.com/library/de...ecpoladmin.asp
for some pointers.
"James" <j DOT w AT zoom DOT co DOT uk> wrote in message
news:ux***************@tk2msftngp13.phx.gbl...
Hi,

I have built a Windows Form Control which is hosted in IE (for our
Intranet). The form logs into a Web Service and retrieves information for
display. However, because the web service is on a different internal
server, we get the error message: "Error in document service. "Request for
the permission of type 'System.Net.WebPermission' failed". We have got
this to work on development machines by raising the trust level of the
machine hosting the webservice - but how do we do this for the clients on
the rest of the domain?

Has anyone seen this before... and if so, and more importantly... can you
suggest how to fix the problem?

We are running Framwework 2.0 and ASP.NET 2.0.

Thanks in advance,
James

Dec 9 '05 #2

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
news:uQ****************@tk2msftngp13.phx.gbl...
There are several options available for deploying CAS policy modifications
over a domain. See
http://msdn.microsoft.com/library/de...ecpoladmin.asp
for some pointers.


Thanks Nicole, so you think that this is simply a policy setting - not that
I should be coding the app differently?

Thanks
James
Dec 12 '05 #3
You cannot elevate the assembly's permissions from within its own code. The
only code change you could make that would remove the requirement for the
additional CAS permissions is one that alters the application's behaviour so
that it no longer needs any permissions besides those granted to the zone
from which it will run (presumably the intranet zone in your case). If
connecting to a web service on a different web site is a fixed and
unavoidable requirement for the control, then I don't see how you can avoid
the additional permissions requirement. That said, moving the web service
(or at least a pass-through facade for the existing web service) to the
control host site would be an obvious approach to consider, but nothing
you've mentioned so far indicates whether that's an option that's available
to you...


"James" <j DOT w AT zoom DOT co DOT uk> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
news:uQ****************@tk2msftngp13.phx.gbl...
There are several options available for deploying CAS policy
modifications over a domain. See
http://msdn.microsoft.com/library/de...ecpoladmin.asp
for some pointers.


Thanks Nicole, so you think that this is simply a policy setting - not
that I should be coding the app differently?

Thanks
James

Dec 12 '05 #4

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
news:ep*************@TK2MSFTNGP11.phx.gbl...
You cannot elevate the assembly's permissions from within its own code.
The only code change you could make that would remove the requirement for
the additional CAS permissions is one that alters the application's
behaviour so that it no longer needs any permissions besides those granted
to the zone from which it will run (presumably the intranet zone in your
case). If connecting to a web service on a different web site is a fixed
and unavoidable requirement for the control, then I don't see how you can
avoid the additional permissions requirement. That said, moving the web
service (or at least a pass-through facade for the existing web service)
to the control host site would be an obvious approach to consider, but
nothing you've mentioned so far indicates whether that's an option that's
available to you...


Hi Nicole,

We spent this morning trying out your suggestion... It Works!

We raised the permissions for our domain to Full Trust for Intranet based
assemblies. Everything now runs perfectly.

Thanks very much for taking the time to answer my post, it is sincerely
appreciated.

James
Dec 12 '05 #5
You might want to consider making the additional permission grant a bit more
restrictive, both with respect to code group membership and the granted
permission set. Granting unrestricted permissions to all code originating
on any network (even an intranet) leaves client machines open to additional
risk that could easily be avoided. For example, in your particular
scenario, it might be quite sufficient to grant only one additional
permission (WebPermission to connect to the target web service address) over
the baseline intranet grant, and you could probably be quite restrictive
about the code group membership criteria that are used to grant this
additional permissions. For example, on top of intranet zone evidence, you
could probably use URL evidence corresponding to your control's URL and
strong name and/or publisher evidence corrresponding to strong name and/or
authenticode signatures applied to the control assembly.

"James" <j DOT w AT zoom DOT co DOT uk> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
news:ep*************@TK2MSFTNGP11.phx.gbl...
You cannot elevate the assembly's permissions from within its own code.
The only code change you could make that would remove the requirement for
the additional CAS permissions is one that alters the application's
behaviour so that it no longer needs any permissions besides those
granted to the zone from which it will run (presumably the intranet zone
in your case). If connecting to a web service on a different web site is
a fixed and unavoidable requirement for the control, then I don't see how
you can avoid the additional permissions requirement. That said, moving
the web service (or at least a pass-through facade for the existing web
service) to the control host site would be an obvious approach to
consider, but nothing you've mentioned so far indicates whether that's an
option that's available to you...


Hi Nicole,

We spent this morning trying out your suggestion... It Works!

We raised the permissions for our domain to Full Trust for Intranet based
assemblies. Everything now runs perfectly.

Thanks very much for taking the time to answer my post, it is sincerely
appreciated.

James

Dec 13 '05 #6

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

Similar topics

3
by: Steven.Xu | last post by:
Hello everyone. Normally, the cell of the System.Windows.Forms.DataGrid could be inputed. How can I let the cells only show something and not be inputed?
1
by: Aurimas Norkevicius | last post by:
I am trying to create an user control with ms word functionality. I succeded to create this control and it is functional in windows forms. I would like to use it in html pages using <object ..>...
5
by: andy.g.ward | last post by:
I keep getting this when trying to create an MFC activex control in a c# windows service - anyone got any ideas what the missing module could be??? Exception thrown :...
2
by: Matt Theule | last post by:
I need to be able to allow users to drag files to a list box on a web page. To this end, I created a Windows Control and hosted it in a WebForm. When the file is dropped onto the listbox, the...
3
by: Dilip | last post by:
Hi I have a windows forms user control that is hosted in IE. This control uses COM Interop to access some RTC related interfaces. The control does not display itself correctly because of this...
0
by: kashif kazi via DotNetMonster.com | last post by:
Hi all I developed the simple windows control and place it on ASP.net page, it runs fine. Now i developed the win control as follows which uses web services (Combine logic of two sample...
2
by: david | last post by:
I am wondering how to embed a windows form into web form for control and interacting with server application (like java applet)? Anyone can give me some clue and guide? Thanks
5
by: John Smith | last post by:
Hi folks, I'm embedding a Windows Forms User Control into an aspx web page. I've created the class library in C# and added the user control to it. If the control just has simple Windows Forms...
5
by: Keith | last post by:
Please help. I've been developing a windows forms user control to be hosted in IE/ASP.NET. The control is developed in .NET v1.1, and for now I'll need to keep it in that version. Recently I...
0
by: Bosco | last post by:
Hi all, I got a problem with a windows forms control hosted in an asp.net page wich uses another dll, it works just fine when the other dll is placed in the GAC but i can't make it work when it's...
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: 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
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?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.