<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx</link><description>Avoiding security exceptions that occur when you try to provide extra trust based upon strong name or X509 certificates</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#64341</link><pubDate>Thu, 29 Jan 2004 12:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:64341</guid><dc:creator>Crirus</dc:creator><description>I have a application,  embedded in IE (html assambly).&lt;br&gt;That aplication need to connect back to the server in order to get some&lt;br&gt;data.&lt;br&gt;What are conditions to succeed without requesting any special permissions&lt;br&gt;from client? As an applet do it....&lt;br&gt;Should I connect back to the server only using port 80?&lt;br&gt;Right now the client app is serverd by Apache and connection back is tryed&lt;br&gt;to another aplication on port 9500&lt;br&gt;&lt;br&gt;Changing security permission by the client is not an option.. same for stron names.&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#64490</link><pubDate>Thu, 29 Jan 2004 18:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:64490</guid><dc:creator>Shawn</dc:creator><description>This depends on which version of the framework your embedded assembly is targeting.  With v1.0 of the framework, this is not possible without having the client trust your code.  However, with v1.1 and higher, all code run off the internet has same site web access back to where they are hosted from.  You can use the System.Web.HttpWebRequest class to gain access back to this site.</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#66699</link><pubDate>Tue, 03 Feb 2004 16:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:66699</guid><dc:creator>Brian</dc:creator><description>This is the first explanation of the security in the .Net Framework that I've found that makes sense.  I've been trying to create WinForm controls that use the PropertyGrid as a component and have been failing miserably in terms of getting all the functions to work properly.  &lt;br&gt;&lt;br&gt;I figured out the strongname/code group relationship that is required and am able to get the control to work partially.  However, I can't get all the functionality of the PropertyGrid to work in IE.  What I've been stuck on is how one would get expandable object types and custom UItypeeditors to work in the control while in IE.  I've coded the control and when it runs in an executable, the expandable properties work and I can use the ellipsis buttton to call my custom UItypeeditor.  The problem is that hosted in IE, the expandable property doesn't expand and the ellipsis button is not available.&lt;br&gt;&lt;br&gt;From what you're saying is that IE hosts the control in an AppDomain that doesn't have enough permissions to use expandable types or custom UItypeeditors.  So, I have to assert the permissions for my public classes and methods?  Would this apply to all classes and methods (including those for the expandable types and UItypeeditors)?&lt;br&gt;&lt;br&gt;How do you assert the permissions?  Is that when you prefix the class with :&lt;br&gt;&lt;br&gt;&amp;lt;SecurityPermissionAttribute( _&lt;br&gt; SecurityAction.LinkDemand, Unrestricted:=True)&amp;gt;&lt;br&gt;&lt;br&gt;Do you have to prefix every property and method as well?&lt;br&gt;&lt;br&gt;Thanks.</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#66743</link><pubDate>Tue, 03 Feb 2004 18:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:66743</guid><dc:creator>Shawn</dc:creator><description>&amp;lt;p&amp;gt;I'm not very familiar with the PropertyGrid control myself, so I don't know what extra security demands are made of it.  I suspect that you are not actually running into a security problem however, as long as you are asserting for permissions before you create your control.  My first step would be to debug your control's binding to the assembly containing your custom type editors.  For assistance on doing that, check out Suzanne's blog entry: &amp;lt;a href=&amp;quot;&lt;a target="_new" href="http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx&amp;quot;&amp;gt;http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;"&gt;http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx&amp;quot;&amp;gt;http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;Asserting permissions is different from creating a LinkDemand.  To assert permissions, at every entry point to your control (the control's constructor as well as every method called from your HTML page or by IE), you need to create the permissions that the control needs to execute (i.e.  new FileIOPermission(PermissionState.Unrestricted); ), and then call their assert method.</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#82932</link><pubDate>Tue, 02 Mar 2004 23:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:82932</guid><dc:creator>dhega</dc:creator><description>How can I give  a SocketPermission to managed code in IE( winform UserControl) so that the UserControl can open an IP socket to the server that it came from??&lt;br&gt;I will appreciate ur answer!</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#83386</link><pubDate>Wed, 03 Mar 2004 19:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:83386</guid><dc:creator>Shawn</dc:creator><description>This is an interesting question, which I'll write a blog post about this week.  The quick answer is that using the default security objects you can't.  The best you can do is grant same-site web access, and communicate using HTTP or HTTPS.  However, if you write a custom security object to create same-site socket permissions, this is achievable.  I'll post a link back here when I write the blog.</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#87940</link><pubDate>Thu, 11 Mar 2004 15:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:87940</guid><dc:creator>JFortin</dc:creator><description>Greetings!&lt;br&gt;&lt;br&gt;I need help. I am trying to load a usercontrol in IE. I know that the AppDomain has not enough security permissions. I don't think that asserting permissons works for me. Everything works fine for me when I use the site condition with my machine name. When I try with the strong name condition it doesnt load at all. Can you provide a full source of a window control than can be load in IE using ONLY his strong name as a security condition?  There is no documentation on this. Thank you for your time.</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#88212</link><pubDate>Thu, 11 Mar 2004 22:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:88212</guid><dc:creator>Shawn</dc:creator><description>Just saw this on the newsgroups too, so I'll copy and paste my answer from there:&lt;br&gt;&lt;br&gt;Unfortunately, you can't just use the strong name, for reasons I mention in my blog (which I see you've already found ;-) ):  &lt;a target="_new" href="http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx"&gt;http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;I see that you understand that the problem is with the permission set associated with the AppDomain, and not with the assembly itself.  Now what you need to think about are what evidence is available to IE at the time the AppDomain is created (and its PermissionSet assigned).  Since the AppDomain must be created before the assembly is loaded into it, nothing specific about the assembly is available (including the strong name, or authenticode signature).  Instead, you have only the site, URL, and zone evidence to work with.  In order to get your control to work, you'll need to use a membership condition that matches one of these types of evidence to grant trust to your control.  Since you say that you've gotten this to work already on your dev machine with the site membership condition, I see that you didn't have a problem getting that far.&lt;br&gt;&lt;br&gt;Is there a specific reason you need to move away from using the site membership condition?&lt;br&gt;</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#88215</link><pubDate>Fri, 12 Mar 2004 01:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:88215</guid><dc:creator>.Net Security Blog</dc:creator><description /></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#163755</link><pubDate>Wed, 23 Jun 2004 16:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:163755</guid><dc:creator>Wendy</dc:creator><description>Hi, I'm not very familiar with .NET security (or .NET for that matter), but I did develop a user control that is embedded in IE and am getting the problems that you described in the blog.&lt;br&gt;&lt;br&gt;I'm not sure how to word this, but calling Assert() on a Permission will only work if my user control is allowed to be able to get access to whatever I'm asking permission for right? For example, I tried new WebPermission(PermissionState.Unrestricted).Assert() and got a SecurityException. I found that only when I add my dll to a code group in the client machine with some sort of trust would the Assert() method call work.&lt;br&gt;&lt;br&gt;Am I completely off track here?&lt;br&gt;&lt;br&gt;So is it even possible for the client machines (anywhere on the internet) to load my application (a dll embedded in a webpage) without making changes to their security policy on their machine?&lt;br&gt;&lt;br&gt;Thanks</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#163763</link><pubDate>Wed, 23 Jun 2004 16:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:163763</guid><dc:creator>Shawn</dc:creator><description>Hi Wendy,&lt;br&gt;&lt;br&gt;    You're correct, Asserting a permission requires that you be granted the permission in the first place.  This post is mostly about getting the control to not throw once it has already been granted permissions.&lt;br&gt;&lt;br&gt;If you need to have the user's machines trust your code, you have two options.  The easiest would be to simply code with only those permissions that appear in the Internet code group.  If that's not a possibility, then another option is for you to modify the policy of your local machine so that your control is trusted (see my post here for information on that: &lt;a target="_new" href="http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx"&gt;http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx&lt;/a&gt;  ... I recommend trusting based on strong name), and then creating an .MSI deployment file out of the policy, and placing that on your website.  Have users install the custom policy before running your control, and then your Asserts should work fine.&lt;br&gt;&lt;br&gt;-Shawn</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#164000</link><pubDate>Wed, 23 Jun 2004 19:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:164000</guid><dc:creator>Wendy</dc:creator><description>Hi Shawn,&lt;br&gt;&lt;br&gt;Thanks for such a quick reply.&lt;br&gt;&lt;br&gt;I don't think that the .MSI deployment file is a viable solution since we don't want our users to have to deliberately download and install something.&lt;br&gt;&lt;br&gt;The actual problem I'm having is that my windows control needs to access an .aspx page that is located on the same web server that the control .dll is from. If the user (who could be connecting from anywhere on the internet) who downloaded the .dll is not connected to the internet through a proxy server, everything works perfectly. But if the user is connected through a proxy server, I get a HTTP 407 Authorization Required error when my code does a httpwebrequest.GetResponse(). I realized that HttpWebRequest has a Proxy property, however whenever I try to access that property, I get a SecurityException stating that the request for type WebPermission has failed. I tried to Assert a WebPermission with PermissionState.Unrestricted as parameter, but that caused a SecurityException as well. I'm assuming this is because my application isn't granted unrestricted WebPermission. Given this information, do you know if I need any kind of extra permissions that are not available just by adding the site that the control .dll is from to the Trusted Sites list in IE?&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Wendy</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#165149</link><pubDate>Thu, 24 Jun 2004 21:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:165149</guid><dc:creator>Shawn</dc:creator><description>Right, your application is not granted unrestricted web permission, but you should have same site web access.  Try just asserting for access back to your site.&lt;br&gt;&lt;br&gt;The reason you can't go unrestriced is if we allowed all web controls to have unrestricted web access by default, it would open up huge cross-site scripting holes.&lt;br&gt;&lt;br&gt;-Shan</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#169591</link><pubDate>Wed, 30 Jun 2004 08:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:169591</guid><dc:creator>Pieter</dc:creator><description>Excellent! Thanks a Million. This really helped me sort out my problem!</description></item><item><title>re: Creating an AppDomain with limited permissions</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#251249</link><pubDate>Tue, 02 Nov 2004 22:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:251249</guid><dc:creator>.Net Security Blog</dc:creator><description /></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#409280</link><pubDate>Mon, 18 Apr 2005 19:27:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:409280</guid><dc:creator>Shailendra Jain</dc:creator><description>Hi,&lt;br&gt;Thanks for this wonderful insight. I actually tried creating a limited permission appdomain with codegroup having only named permission &amp;quot;Execution&amp;quot;. To provide full access to my own assemblies I added them as fulltrust assemblies. Also I created another fulltrust codegroup for these assemblies using UnionCodeGroup and added it as a child of root codegroup. However I still get the security exception. It would be nice If you could provide a code snippet based on strongnamemembershipcondition to clarify doubts of mortals like us. Thanks.&lt;br&gt;- Shailendra</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#409339</link><pubDate>Mon, 18 Apr 2005 21:34:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:409339</guid><dc:creator>alfie</dc:creator><description>Hi, thanks for the info. Was tearing my hair out trying to understand how this works. But I still have issues...&lt;br&gt;&lt;br&gt;Issue #1. I've granted UIPermission.AllWindows to my assembly using URL method. I call&lt;br&gt;&lt;br&gt;  new UIPermission(UIPermissionWindow.AllWindows).Assert()&lt;br&gt;&lt;br&gt;in my constructor and it passes (doesn't throw an exception).&lt;br&gt;&lt;br&gt;However, as soon as I override PreTranslateMessage in my class my control fails to load - I just get the red X. From the docs this just requires UIPermissionWindow.AllWindows. I really need these lower-level overrides for my control.&lt;br&gt;&lt;br&gt;Issue #2. If I use the strong name method my control fails to load - red X again. Doesn't matter what code I put in the class (ie. I don't call any code that requires special permissions).&lt;br&gt;&lt;br&gt;Any help much appreciated.&lt;br&gt;&lt;br&gt;Alfie.</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#409420</link><pubDate>Tue, 19 Apr 2005 00:55:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:409420</guid><dc:creator>alfie</dc:creator><description>Ok, I think I understand(?) what's going on from a bit of digging.&lt;br&gt;&lt;br&gt;The second issue is the AllowPartiallyTrustedCallers problem. Once I added that it went away.&lt;br&gt;&lt;br&gt;The first issue seems to be a documentation error. If I use Reflector, ProcessCmdKey seems to require UnmanagedCode access. It has:&lt;br&gt;&lt;br&gt;[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true), SecurityPermission(SecurityAction.InheritanceDemand, UnmanagedCode=true)]&lt;br&gt;&lt;br&gt;By the way, the Message struct which is one of the parameters also has UnmanagedCode=true.&lt;br&gt;&lt;br&gt;Is this correct? Do I really need full trust to use a control that overrides ProcessCmdKey (and others)?&lt;br&gt;&lt;br&gt;What's annoying is that I rewrote a lot of  code to use GDI+ rather than PInvoke to avoid requiring full trust and now I find I need it anyway!&lt;br&gt;&lt;br&gt;Thanks, Alfie.</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#550726</link><pubDate>Mon, 13 Mar 2006 23:51:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:550726</guid><dc:creator>mgraves</dc:creator><description>FYI, in answer to the &amp;quot;How can I give a SocketPermission to managed code in IE?&amp;quot; question, you can assert multiple stack walk modifiers / permission sets simultaneously to create a socket by doing something like this:&lt;br&gt;&lt;br&gt;PermissionSet ps = new PermissionSet(PermissionState.None);&lt;br&gt;ps.AddPermission(new SocketPermission(PermissionState.Unrestricted));&lt;br&gt;ps.AddPermission(new SecurityPermission(PermissionState.Unrestricted));&lt;br&gt;ps.Assert();&lt;br&gt;</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#552917</link><pubDate>Thu, 16 Mar 2006 18:46:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:552917</guid><dc:creator>Richard</dc:creator><description>Hi shawn,&lt;br&gt;&lt;br&gt;I change the clinet CAS to full trush Internet zone, why I still get this.&lt;br&gt;&lt;br&gt;Thanks&lt;br&gt;&lt;br&gt;Richard&lt;br&gt;&lt;br&gt;************** Exception Text **************&lt;br&gt;System.Security.SecurityException: Request for the permission of type 'System.Net.SocketPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.&lt;br&gt; &amp;nbsp; at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark&amp;amp; stackMark, Boolean isPermSet)&lt;br&gt; &amp;nbsp; at System.Security.CodeAccessPermission.Demand()&lt;br&gt; &amp;nbsp; at System.Net.Sockets.Socket.CheckCacheRemote(EndPoint&amp;amp; remoteEP, Boolean isOverwrite)&lt;br&gt; &amp;nbsp; at System.Net.Sockets.Socket.SendTo(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, EndPoint remoteEP)&lt;br&gt; &amp;nbsp; at System.Net.Sockets.Socket.SendTo(Byte[] buffer, EndPoint remoteEP)&lt;br&gt; &amp;nbsp; at ActiveXDotNet.UDPClient.btnJoin_Click(Object sender, EventArgs e)&lt;br&gt; &amp;nbsp; at System.Windows.Forms.Control.OnClick(EventArgs e)&lt;br&gt; &amp;nbsp; at System.Windows.Forms.Button.OnClick(EventArgs e)&lt;br&gt; &amp;nbsp; at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)&lt;br&gt; &amp;nbsp; at System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)&lt;br&gt; &amp;nbsp; at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)&lt;br&gt; &amp;nbsp; at System.Windows.Forms.ButtonBase.WndProc(Message&amp;amp; m)&lt;br&gt; &amp;nbsp; at System.Windows.Forms.Button.WndProc(Message&amp;amp; m)&lt;br&gt; &amp;nbsp; at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)&lt;br&gt; &amp;nbsp; at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)&lt;br&gt; &amp;nbsp; at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&lt;br&gt;The action that failed was:&lt;br&gt;Demand&lt;br&gt;The type of the first permission that failed was:&lt;br&gt;System.Net.SocketPermission&lt;br&gt;The Zone of the assembly that failed was:&lt;br&gt;Internet&lt;br&gt;</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#553022</link><pubDate>Thu, 16 Mar 2006 20:15:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:553022</guid><dc:creator>Richard</dc:creator><description>I have below code, without any attribute assertion, I got RegistryPermission failed at Internet Zone.&lt;br&gt;when I added [RegistryPermission(SecurityAction.Assert, Unrestricted = true)]&lt;br&gt;, I got SecurityPermission failed at My computer zone.&lt;br&gt;After I added [SecurityPermission(SecurityAction.Assert, Unrestricted = true)]&lt;br&gt;, I still got same exception.&lt;br&gt;&lt;br&gt;Both internet zone and my computer zone has full trust to its own zone.&lt;br&gt;&lt;br&gt;Can you help me out with this?&lt;br&gt;&lt;br&gt;Thanks.&lt;br&gt;&lt;br&gt;private void btnJoin_Click(object sender, System.EventArgs e)&lt;br&gt;{&lt;br&gt; Microsoft.Win32.RegistryKey rk;&lt;br&gt;rk = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(&lt;br&gt;	&amp;quot;Software\\Microsoft\\.NetFramework&amp;quot;,false);&lt;br&gt;				string[] skNames = rk.GetSubKeyNames();&lt;br&gt;				for (int i=0;i&amp;lt;skNames.Length;++i)&lt;br&gt;&lt;br&gt;				{&lt;br&gt;&lt;br&gt;					Console.WriteLine(&amp;quot;Registry Key: {0}&amp;quot;, skNames[i]);&lt;br&gt;&lt;br&gt;				}&lt;br&gt;&lt;br&gt; 				rk.Close();&lt;br&gt;		}</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#553189</link><pubDate>Thu, 16 Mar 2006 23:56:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:553189</guid><dc:creator>mgraves</dc:creator><description>I reccomend strong naming your assembly and creating a new code group that specifies the strong name and not worry about the other zones.&lt;br&gt;&lt;br&gt;If you set the keyfile into your project for Wrapper Assembly Key File when you add your reference it will strong name the wrapper using your key.&lt;br&gt;&lt;br&gt;Also if you need to use tlbimp or aximp you can also set your keyfile.&lt;br&gt;&lt;br&gt;I was having problems using the attribute assertions, so I just use &lt;br&gt;&lt;br&gt;PermissionSet ps = new PermissionSet(PermissionState.None); &lt;br&gt;ps.AddPermission(new SocketPermission(PermissionState.Unrestricted)); &lt;br&gt;ps.AddPermission(new SecurityPermission(PermissionState.Unrestricted)); &lt;br&gt;ps.Assert(); &lt;br&gt;&lt;br&gt;and life is good.&lt;br&gt;</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#553912</link><pubDate>Fri, 17 Mar 2006 20:50:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:553912</guid><dc:creator>Richard</dc:creator><description>Is there any way to bypass permission check without setting the client code groups?&lt;br&gt;</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#598387</link><pubDate>Tue, 16 May 2006 01:57:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:598387</guid><dc:creator>mgraves</dc:creator><description>FYI, I recently ran into an issue where I create a CAG that fully trusted the strong name key through a Deployment Package, but when I loaded the page with the assembly it would throw SecurityExceptions or tell me in the IE Debug log that &amp;quot;that assembly does not allow partially trusted callers&amp;quot;, when it certainly did trust them. &lt;br&gt;&lt;br&gt;I was developing on Win 2000 with 1.1 (and this worked fine) and then tested on XP Pro SP2 with 1.1 and 2.0&lt;br&gt;&lt;br&gt;The problem is that I was creating the CAG in the .Net 1.1 framework only and IE was using the .Net 2.0 Framework when it loads inside of its own app domain.&lt;br&gt;&lt;br&gt;The fix was to create an identical CAG for the .Net 2.0 framework using mscorcfg or caspol.exe. I have to check for the newer framework version even though my app and installer only need 1.1. &amp;nbsp;&lt;br&gt;&lt;br&gt;This will be a maintenence issue, since IE uses the latest installed version of .Net for some reason, any &amp;quot;.Net Framework 2.1&amp;quot; upgrades will break this in the same way.&lt;br&gt;&lt;br&gt;This discovery cost me one ms support incident, enjoy!&lt;br&gt;</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#606448</link><pubDate>Thu, 25 May 2006 00:51:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:606448</guid><dc:creator>Phil</dc:creator><description>Hello,&lt;br&gt;&lt;br&gt;I have written a windows forms control that we are attempting to host in an &lt;br&gt;IE browser. The application hosting the control is ASP.NET. The control uses &lt;br&gt;the following CAS permissions: IsolatedStorageFilePermission, &lt;br&gt;SqlClientPermission. Using a strong name I have signed both the web &lt;br&gt;application and the windows forms control. In addition I created a code group &lt;br&gt;below intranet applications that specifies this strong name and allows full &lt;br&gt;trust. This has alleviated the IsolatedStorageFilePermission exception. &amp;nbsp;&lt;br&gt;However, the application still throws the SqlClientPermission exception any &lt;br&gt;time it attempts to access a SQL Server resource.&lt;br&gt;&lt;br&gt;Any ideas and/or thoughts would be apperciated.&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Phil</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#607194</link><pubDate>Thu, 25 May 2006 19:23:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:607194</guid><dc:creator>Julia Hayward</dc:creator><description>I have a Windows Forms app running in IE which needs to make use of a web service (.ASMX page) hosted at the same site as the DLL is downloaded from. It's all built in .NET and I'm using the proxy class that Visual Studio builds to talk to the ASMX page. &lt;br&gt;&lt;br&gt;However, even though it only tries to contact the same site, I get web permission exceptions when running in the Local Intranet zone, which according to the documentation ought to allow this by default. If I bump up the zone to full trust, everything works - but clients don't like me asking them to do this!&lt;br&gt;&lt;br&gt;Signing the assembly is not (yet) an option as it simply doesn't run in that case.&lt;br&gt;&lt;br&gt;Is there anything I can put in my code to fix this? Any other ideas?</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#613436</link><pubDate>Fri, 02 Jun 2006 01:13:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:613436</guid><dc:creator>shawnfa</dc:creator><description>Hi Julia,&lt;br&gt;&lt;br&gt;You should be able to get details from the SecurityException about what you were actually granted and what demand failed -- from there you can see the difference between the WebPermission you have and the one that you're trying to use.&lt;br&gt;&lt;br&gt;-Shawn</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#629256</link><pubDate>Tue, 13 Jun 2006 11:38:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:629256</guid><dc:creator>jomarbernedo</dc:creator><description>Hi. I am developing &amp;nbsp;an ie based project which needs to have full-trust in internet zone for it to function well. I was just wondering what can i do if i want my specific sight (and only my sight) to have full trust in internet zone of clients viewing it? can i place my web address in their registry or sumthing then it will detect that this site has full trust in internet zone?&lt;br&gt;help needed badly...</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#631220</link><pubDate>Wed, 14 Jun 2006 21:31:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:631220</guid><dc:creator>shawnfa</dc:creator><description>Sure -- you can use the Url membership condition for that. &amp;nbsp;You'd want to have a command line like:&lt;br&gt;&lt;br&gt;caspol -m -ag 1.2 -url &lt;a rel="nofollow" target="_new" href="http://YourSite.com/"&gt;http://YourSite.com/&lt;/a&gt;* FullTrust&lt;br&gt;&lt;br&gt;-Shawn</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#632095</link><pubDate>Thu, 15 Jun 2006 14:52:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:632095</guid><dc:creator>jomarbernedo</dc:creator><description>Ei thanx! But can I imbed it in C# or ASP.NET? I want to automatically set the settings of the viewer when he tries to view my page.</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#634511</link><pubDate>Fri, 16 Jun 2006 23:18:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:634511</guid><dc:creator>shawnfa</dc:creator><description>No you cannot. &amp;nbsp;If code running on the Internet was able to modify policy on anyone's machine to trust themselves, then there's not really much point to the security system :-)&lt;br&gt;&lt;br&gt;What's going to prevent some malicious code from doing the same thing?&lt;br&gt;&lt;br&gt;-Shawn</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#636041</link><pubDate>Sun, 18 Jun 2006 15:14:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:636041</guid><dc:creator>kiran</dc:creator><description>I created an asp application that creates a word object,fills in the necessary content and sends this mail as an attachment..teh application is working fine from the server which is my machine..but when acessed from a client machine it throws an object required error..Can someone plz help me on this as i am stuck up on this for 1 week..plz help&lt;br&gt;thx kiran</description></item><item><title>How to access assemblies installed on client from Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#809529</link><pubDate>Mon, 09 Oct 2006 22:56:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:809529</guid><dc:creator>Craig P</dc:creator><description>I want to display a UserControl on a web page using an &lt;object&gt; tag.  The 
control has dependent assemblies that are quite large.  These assemblies are 
installed on the client (not in GAC), but I don't see a way to use them.  The dependent 
assemblies are always download from the web server resulting in intolerable 
performance.  I have tried using an application configuration file to specify probing privatePath, but the 
Fusion log reports that it won't probe the specified client location because 
that is outside the appbase.

In the old days of ActiveX, It was possible to download and install whatever was needed and simply activate it on the web page after that.  This provided huge value in terms of good performance, ability to do things on the client not allowed/supported by the browser, and simplicity.  I'm hoping there is a way to gain those benefits but with the much better security offered by code access control and UserControls.
</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#1087385</link><pubDate>Thu, 16 Nov 2006 20:09:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1087385</guid><dc:creator>Brutus</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I followed the thread and I am very confused:&lt;/p&gt;
&lt;p&gt;Finally, Is it possible to execute the .net assembly with all the trust permission without changing anything on the client side?&lt;/p&gt;
&lt;p&gt;We previously have been using a signed ActiveX in a CAB that was working fine, and try to port it to C#.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;mauro.asprea@nektra.com&lt;/p&gt;</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#1313199</link><pubDate>Mon, 18 Dec 2006 04:05:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1313199</guid><dc:creator>shawnfa</dc:creator><description>&lt;p&gt;No, it is not currently possible to elevate your permissions on the client side for a control. &amp;nbsp;The closest option is ClickOnce which will allow you to prompt and elevate an application -- although this application will not be hosed in the web page.&lt;/p&gt;
&lt;p&gt;-Shawn&lt;/p&gt;
</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#1454822</link><pubDate>Fri, 12 Jan 2007 14:50:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1454822</guid><dc:creator>DeniX</dc:creator><description>&lt;p&gt;I have windows forms control (CLR 2.0) hosted on aspx page. It need access asmx web service on the same site. Site use integr. authorization.&lt;/p&gt;
&lt;p&gt;Users connect to site via Internet. Site is in trusted zone in cas is Full trust. Wher control execute webService i have 401 error.&lt;/p&gt;
&lt;p&gt;What can i do to resolve this.&lt;/p&gt;</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#1456140</link><pubDate>Fri, 12 Jan 2007 18:55:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1456140</guid><dc:creator>DeniX</dc:creator><description>&lt;p&gt;I need to invoke web service from WinForm Control on aspx page. But I have 401. &lt;/p&gt;
&lt;p&gt;I need to invoke WS in context of page user (not local user).&lt;/p&gt;
&lt;p&gt;Is it posible?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#1468774</link><pubDate>Mon, 15 Jan 2007 11:02:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1468774</guid><dc:creator>DeniX</dc:creator><description>&lt;p&gt;I have a application, embedded in IE (html assambly). &lt;/p&gt;
&lt;p&gt;That aplication need to connect back to the server in order to get some &lt;/p&gt;
&lt;p&gt;data (asmx web service). &lt;/p&gt;
&lt;p&gt;Web site use intergated auth, but &amp;nbsp;client computer is not in WebServer domain.&lt;/p&gt;
&lt;p&gt;I have 401 when invoke Wen service.&lt;/p&gt;
&lt;p&gt;How can I get data from servver.&lt;/p&gt;
&lt;p&gt;Please help!&lt;/p&gt;</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#1484446</link><pubDate>Wed, 17 Jan 2007 21:30:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1484446</guid><dc:creator>shawnfa</dc:creator><description>&lt;p&gt;Hi DeniX,&lt;/p&gt;
&lt;p&gt;I'm not a web service authentication expert, so I'm not sure how to answer your question. I recommend checking out the MSDN forums, where someone will be able to help you with your authentication questions.&lt;/p&gt;
&lt;p&gt;-Shawn&lt;/p&gt;
</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#1827611</link><pubDate>Wed, 07 Mar 2007 16:33:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1827611</guid><dc:creator>Laca</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I want to use a .net object in IE. (Directoryservices) &lt;/p&gt;
&lt;p&gt;Can I give full-trust to it? Without modifying anything on client machine.&lt;/p&gt;
&lt;p&gt;Maybe with a certificate or a popup at the client, that he gives full trust to this activex.&lt;/p&gt;
&lt;p&gt;Thanks Laszlo.&lt;/p&gt;</description></item><item><title>Specifying Permissions for IE Controls in Orcas</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#1830279</link><pubDate>Wed, 07 Mar 2007 22:47:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1830279</guid><dc:creator>RSS It All</dc:creator><description>&lt;p&gt;One of my most read blog posts (and one of the reasons I created this blog in the first place -- to answer&lt;/p&gt;
</description></item><item><title>Specifying Permissions for IE Controls in Orcas</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#1831336</link><pubDate>Thu, 08 Mar 2007 02:07:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1831336</guid><dc:creator>.Net Security Blog</dc:creator><description>&lt;p&gt;One of my most read blog posts (and one of the reasons I created this blog in the first place -- to answer&lt;/p&gt;
</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#1845311</link><pubDate>Fri, 09 Mar 2007 18:26:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1845311</guid><dc:creator>Alvin Bruney</dc:creator><description>&lt;p&gt;I'm annoyed at the fact that there is no viable solution for this at the enterprise level today. Orcas isn't out yet. Clickonce has its issues. On a fundamental level, elevating the code trust for a site, url or zone in order to have a usercontrol run flies in the face of security. It is just as bad as running an ActiveX because a site, zone or url receives more permissions than it requires. Roll that out to the enterprise and it opens up a massive hole ripe for hacking. What do we do TODAY to make this work in a way that is safe for an enterprise? The *solutions* provided are bandaids that do not address the underlying issue. I'm not referring to this within the context of one or two desktops, i'm putting this in the context of a government or large instituion with hundreds of thousands of client machines. You can't reasonably expect to raise the permissions of a site, zone or url to full trust? Or did i take a wrong turn somewhere?&lt;/p&gt;</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#1846462</link><pubDate>Fri, 09 Mar 2007 21:09:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1846462</guid><dc:creator>shawnfa</dc:creator><description>&lt;p&gt;Hi Alvin,&lt;/p&gt;
&lt;p&gt;I'm not sure I entirely understand your points. &amp;nbsp;ClickOnce aside (it's not really the same thing -- it allows for installing applciations locally, whereas we're talking about hosting a control in a web page here), let me look at your other points.&lt;/p&gt;
&lt;p&gt;You don't have to elevate a Zone, Site, or URL to get this scenario to work. &amp;nbsp;I totally agree that elevating a zone is almost certainly the wrong way to go. &amp;nbsp;You can use StrongName or Publisher evience to elevate your control, however that means the AppDomain itself will not be trusted. &amp;nbsp;To solve this, you can place Asserts at the entry points of your control so that demands never hit the AppDomain boundary.&lt;/p&gt;
&lt;p&gt;-Shawn&lt;/p&gt;
</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#1846466</link><pubDate>Fri, 09 Mar 2007 21:11:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1846466</guid><dc:creator>shawnfa</dc:creator><description>&lt;p&gt;Hi Laca,&lt;/p&gt;
&lt;p&gt;You can't do this without modifying anything on the client machine. &amp;nbsp;(Think of how much malware would love to be able to elevate on client machines!).&lt;/p&gt;
&lt;p&gt;In Orcas there is a feature that allows controls to carry a manifest which states it needs to be trusted, and if that manifest is signed by a trusted publisher (you'll have to push the trusted publisher down to client machines), then it will run with the requested permissions.&lt;/p&gt;
&lt;p&gt;-Shawn&lt;/p&gt;
</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#1896338</link><pubDate>Fri, 16 Mar 2007 23:45:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1896338</guid><dc:creator>rpt2k</dc:creator><description>&lt;p&gt;First of all Thank you for maintaing this blog. This is very usefull and informative. There is very little (if any) documentation available on this issue. Here is my situation. I have a user control which I am hosting in IE. This is signed using a strong name. I have created a new CodeGroup and the membership condition is the publik key part of the strong name. Everything works fine in both the Intranet and Internet zone in IE. Except, when a modal form pops up in the Internet Zone, it has a .NET security warning bubble associated with it, warning not to enter password and other stuff on the dialog. ( The form/dialog does not have any textboxes on it). This does not happen in Intranet zone. I am confused as to the behaviour. I will really appreciate your input/suggestions for resolving this issue. &lt;/p&gt;
&lt;p&gt;Thanks much.&lt;/p&gt;
</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#1989607</link><pubDate>Thu, 29 Mar 2007 20:35:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1989607</guid><dc:creator>shawnfa</dc:creator><description>&lt;p&gt;That behavior is from the Windows Forms classes, which I believe (but am not 100% sure) base it upon the zone of the form rather than the trust level of the form.&lt;/p&gt;
&lt;p&gt;You could try asking over in the WinForms group on the MSDN forums, where someone who is better versed in WinForms could provide a more authoratitive answer.&lt;/p&gt;
&lt;p&gt;-Shawn&lt;/p&gt;
</description></item><item><title>re: How to provide extra trust for an Internet Explorer hosted assembly</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#2530990</link><pubDate>Fri, 11 May 2007 01:15:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2530990</guid><dc:creator>IvanK</dc:creator><description>&lt;p&gt;I have a .NET control hosted in IE, which uses WSE2 (Microsoft.Web.Services2.dll) to connect back to the server and download files which are later loaded into MS Office applications (Excel, Word, Outlook).&lt;/p&gt;
&lt;p&gt;WSE2 requires FullTrust and does not trust partially trusted callers. &lt;/p&gt;
&lt;p&gt;My solution so far is to set a URL/Site based policy entry, which grants FullTrust.&lt;/p&gt;
&lt;p&gt;The problem is - how to deploy this policy with minimum client involvement?&lt;/p&gt;
&lt;p&gt;1.	Provide the power users with a document, which describes for them how to do the change using .NET Framework Configuration tool. &lt;/p&gt;
&lt;p&gt;Problem – too much user involvement and .NET 2.0 doesn’t even come with Configuration tool (you have to install the SDK to get it – that’s &amp;nbsp;way too much to ask from the end user)&lt;/p&gt;
&lt;p&gt;2.	The built-in tools - The msi file, generated by the Framework Configuration Tool simply replaces the whole policy instead of only updating it. &lt;/p&gt;
&lt;p&gt;Problem - while this might be considered somewhat OK for well established enterprise-wide situations - it's completely ridiculous each policy “update” to wipe out everything else at that level. On top of that it seems that the msi toggles between install and uninstall no matter how it’s called. Also with the generated msi, there’s no way to change the URL/Site which is different for every client we have.&lt;/p&gt;
&lt;p&gt;3.	To deal with the above situation, I wrote an ActiveX control, which again is launched from a page to set the required .NET CAS permissions. As long as the user has enough Windows permissions and ActiveX controls are allowed, it doesn’t need anything else to “update” the .NET security policy (for the highest CLR version it finds on the machine). This worked just fine in XP...Then Vista came along…and ActiveX basically lost that ability. It’s signed, marked safe for Scripting and Initialization, but I don’t know of any way for the ActiveX to request elevated Windows permissions to run caspol.exe in order to update the policy. In an exe, I can embed a manifest and require admin rights. Then at runtime Vista will prompt for rights elevation if the user can in fact obtain them. &lt;/p&gt;
&lt;p&gt;Problem - how can I do the same an ActiveX?&lt;/p&gt;</description></item><item><title>have created a windows library control that accesses a local sql database</title><link>http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx#9383281</link><pubDate>Thu, 29 Jan 2009 19:00:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9383281</guid><dc:creator>Tayfun KAPUSUZ</dc:creator><description>&lt;p&gt; have created a windows library control that accesses a local sql database&lt;/p&gt;
&lt;p&gt;I tried the following strings for connecting&lt;/p&gt;
&lt;p&gt;Dim connectionString As String = &amp;quot;Data Source=localhost\SQLEXPRESS;Initial Catalog=TimeSheet;Trusted_Connection = true&amp;quot;&lt;/p&gt;
&lt;p&gt;Dim connectionString As String = &amp;quot;Data Source=localhost\SQLEXPRESS;Initial Catalog=TimeSheet;Integrated Security=SSPI&amp;quot;&lt;/p&gt;
&lt;p&gt;I am not running the webpage in a virtual directory but in &lt;/p&gt;
&lt;p&gt;C:\Inetpub\wwwroot\usercontrol&lt;/p&gt;
&lt;p&gt;and I have a simple index.html that tries to read from an sql db but throws&lt;/p&gt;
&lt;p&gt;the error&lt;/p&gt;
&lt;p&gt;System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark&amp;amp; stackMark, Boolean isPermSet)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at System.Security.PermissionSet.Demand()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at System.Data.Common.DbConnectionOptions.DemandPermission()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at System.Data.SqlClient.SqlConnection.PermissionDemand()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection,&lt;/p&gt;
&lt;p&gt;etc etc&lt;/p&gt;
&lt;p&gt; The action that failed was:&lt;/p&gt;
&lt;p&gt;Demand&lt;/p&gt;
&lt;p&gt;The type of the first permission that failed was:&lt;/p&gt;
&lt;p&gt;System.Data.SqlClient.SqlClientPermission&lt;/p&gt;
&lt;p&gt;The Zone of the assembly that failed was:&lt;/p&gt;
&lt;p&gt;Trusted&lt;/p&gt;
&lt;p&gt;I looked into the .net config utility but it says unrestricted and I tried adding it to the trusted internet zones in ie options security&lt;/p&gt;
&lt;p&gt;I think that a windows form connecting to a sql database running in a webpage should be simple&lt;/p&gt;
&lt;p&gt;to configure what am I missing?&lt;/p&gt;</description></item></channel></rss>