473,770 Members | 2,144 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Web Permission' 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 1313
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******** *******@tk2msft ngp13.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.Web Permission' 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******** ********@tk2msf tngp13.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******** ********@TK2MSF TNGP09.phx.gbl. ..

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
news:uQ******** ********@tk2msf tngp13.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******** *****@TK2MSFTNG P11.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******** ********@TK2MSF TNGP11.phx.gbl. ..

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
news:ep******** *****@TK2MSFTNG P11.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
1666
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
1724
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 ..> tag. I can embed my controls into the web page easily until i do not reference word com object. Does anybody has any ideas how to create a control whitch could use word com object on client computer. Thank you.
5
8782
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 : System.IO.FileNotFoundException: The specified module could not be found. at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid) at System.Windows.Forms.AxHost.CreateWithoutLicense() at...
2
1883
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 path of the file is truncated down to 8.3 format (with the ~1 at the end). When the Windows control is hosted in a windows form (for testing purposes) the full path is displayed. Is there some setting that will allow the full path to be displayed...
3
1531
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 COM reference. IF I remove all references to the tlbimp'ed COM dll, the control displays just fine. Basically a plain vanilla user control has no problems displaying itself. Upon further investigation with fuslogvw, I found out that the MSHTML
0
1305
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 applications ) Step 1: Created simple windows application (UserForm) which shows FolderBrowseDialog box On button click Event of form (set output type to class library under project configuration settings after build)
2
4220
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
1264
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 Controls (like TextBoxes or Buttons), it works fine. IE treats it wonderfully If I do something a little more advanced though (like connecting to the Outlook Object Model in code, or embedding the Web Browser Control...), then
5
1750
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 installed .NET 2.0. Now the control loads into .NET 2.0 instead of 1.1 (per System.Environment.Runtime) on my development box. I'm using an app.config file that I'm pulling into the aspx page using a <link> element. In that config file I'm...
0
816
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 placed either in the root directory of the website or in the Bin folder. I've tried to modify the web.config file to change the path where the runtime searches for the dll but it doesn't work. This what i added to the web.config file: <runtime>...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9906
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.