<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-8451123064758809734.post1900543564598099122..comments</id><updated>2012-01-28T01:42:51.699-08:00</updated><category term='Personal'/><category term='Windows XP'/><category term='Visual Studio'/><category term='Windows 2003'/><category term='Differencing Disk'/><category term='SQL Server'/><category term='AJAX'/><category term='Oracle'/><category term='ASP.NET'/><category term='OS X'/><category term='Chrome'/><category term='Safari'/><category term='.net'/><category term='Apache'/><category term='Virtualization'/><category term='SSIS'/><category term='Weird Errors'/><category term='Mail'/><category term='Sharepoint 2007'/><category term='XSLT'/><category term='CSS'/><category term='Excel 2007'/><category term='Subversion'/><category term='TextEditors'/><category term='Health Analyzer'/><category term='OLE DB'/><category term='Troubleshooting'/><category term='SharePoint'/><category term='SPMetal'/><category term='SharePoint 2010'/><category term='IIS'/><category term='Reporting Services'/><category term='ADO.NET'/><category term='Claims Based Authentication'/><category term='Learning'/><category term='Rants'/><category term='SharePoint Designer 2010'/><category term='SEO'/><category term='Active Directory'/><category term='Database'/><category term='Stong Name'/><category term='HTML'/><category term='Tools'/><category term='Commerce Server'/><category term='SMO'/><category term='JavaScript'/><category term='Linq To SharePoint'/><category term='FBA'/><category term='Utilities'/><title type='text'>Comments on System.What?: Creating a Custom CAS Policy File For SharePoint</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.tylerholmes.com/feeds/1900543564598099122/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html'/><author><name>Tyler Holmes</name><uri>http://www.blogger.com/profile/17433652947830098796</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://4.bp.blogspot.com/_1fgwbJk7Clg/TLYBwzTYpLI/AAAAAAAAAAM/V36n7Dinl2s/S220/%5BMugShot-Cropped.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-1302850896441682507</id><published>2012-01-28T01:42:51.699-08:00</published><updated>2012-01-28T01:42:51.699-08:00</updated><title type='text'>After apply my custom Code policy file my applicat...</title><content type='html'>After apply my custom Code policy file my application comes with error.&lt;br /&gt;&lt;br /&gt;Resource not found 404 &lt;br /&gt;/default.aspx&lt;br /&gt;&lt;br /&gt;but with GAC deployment its working fine.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/1302850896441682507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/1302850896441682507'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1327743771699#c1302850896441682507' title=''/><author><name>Hitesh</name><uri>http://www.blogger.com/profile/11055636385433128171</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2073296104'/></entry><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-4579233525638619045</id><published>2011-02-10T04:40:37.801-08:00</published><updated>2011-02-10T04:40:37.801-08:00</updated><title type='text'>Other people have left various solutions to this p...</title><content type='html'>Other people have left various solutions to this problem. I tried them, but only came up with one that worked.&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve Blogged the solution here: http://spfarm.blogspot.com/2011/02/loadcontrol-request-failed.html&lt;br /&gt;&lt;br /&gt;Cheers&lt;br /&gt;Howard</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/4579233525638619045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/4579233525638619045'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1297341637801#c4579233525638619045' title=''/><author><name>Howard</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-727869120'/></entry><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-8762072834930901328</id><published>2010-02-17T07:22:10.754-08:00</published><updated>2010-02-17T07:22:10.754-08:00</updated><title type='text'>Add even a UrlMemberShipCondition which should sol...</title><content type='html'>Add even a UrlMemberShipCondition which should solve your issue.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/8762072834930901328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/8762072834930901328'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1266420130754#c8762072834930901328' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-701708942'/></entry><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-7162260665627355539</id><published>2009-09-16T19:04:37.511-07:00</published><updated>2009-09-16T19:04:37.511-07:00</updated><title type='text'>Try moving the Page.LoadControl method to OnInit m...</title><content type='html'>Try moving the Page.LoadControl method to OnInit method instead of in the CreateControls.  I was getting the exact same error that control could not be found.  &lt;br /&gt;&lt;br /&gt;I saw the article about changing the CAS permission but there are long term issues with that as Chris correctly pointed out.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/7162260665627355539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/7162260665627355539'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1253153077511#c7162260665627355539' title=''/><author><name>Jason Apergis</name><uri>http://www.blogger.com/profile/01817509015412502702</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-353063010'/></entry><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-195237838698245938</id><published>2009-08-25T12:12:35.618-07:00</published><updated>2009-08-25T12:12:35.618-07:00</updated><title type='text'>OK! So I followed your example but inside the root...</title><content type='html'>OK! So I followed your example but inside the root web.config as opposed to just Sharepoint but now I get:&lt;br /&gt;&lt;br /&gt;Parser Error Message: An error occurred loading a configuration file: Request for the permission of type &amp;#39;System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&amp;#39; failed. (machine.config)&lt;br /&gt;&lt;br /&gt;Source Error: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[No relevant source lines]&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Source File: machine.config    Line: 161 &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Line 161 in my machine.config is my custom MembershipProvider:&lt;br /&gt;&lt;br /&gt;add name=&amp;quot;NetPerfectMembershipProvider&amp;quot;&lt;br /&gt;              type=&amp;quot;NetPerfect.MembershipProvider,NetPerfect,version=3.5.0.0,Culture=neutral,PublicKeyToken=9a65a3585a4c74a6&amp;quot;......&lt;br /&gt;&lt;br /&gt;If I dont add it as an IMembershipCondition, then it works fine, but I need to add another functional part that requires reading the siteid from the applicationhosts.config file that will require fulltrust!&lt;br /&gt;&lt;br /&gt;Any ideas why would be much appreciated :s</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/195237838698245938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/195237838698245938'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1251227555618#c195237838698245938' title=''/><author><name>Christian</name><uri>http://ccsalway_at_yahoo.co.uk</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-358036984'/></entry><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-1653589458039287272</id><published>2009-08-17T07:19:43.831-07:00</published><updated>2009-08-17T07:19:43.831-07:00</updated><title type='text'>Tyler,

Regarding your first option listed in your...</title><content type='html'>Tyler,&lt;br /&gt;&lt;br /&gt;Regarding your first option listed in your comment above, Creating a custom CAS Policy:&lt;br /&gt;&lt;br /&gt;This is what we&amp;#39;ve been trying to accomplish, but as it turns out, is not completely possible to define in the solution manifest. The LoadControl() method requires that the PermissionSet node in CAS has Unrestricted=&amp;quot;true&amp;quot;, which is not valid when placed inside the manifest.xml file of the solution. You have to manually add this attribute into the .config file on the server in order to accomplish this. It&amp;#39;s rather bothersome - I hope this can be fixed with the next update of .Net Framework.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/1653589458039287272'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/1653589458039287272'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1250518783831#c1653589458039287272' title=''/><author><name>Chris Speck</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1465761796'/></entry><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-7908127499118919759</id><published>2009-08-14T13:50:29.045-07:00</published><updated>2009-08-14T13:50:29.045-07:00</updated><title type='text'>I believe this is happening because the assembly i...</title><content type='html'>I believe this is happening because the assembly is not running in full trust and does not have the required permissions to reflect on some other control/assembly.&lt;br /&gt;&lt;br /&gt;To remedy this you should consider either:&lt;br /&gt;1) Creating a custom CAS policy for your application granting your assembly full trust.&lt;br /&gt;2) GACing the assembly that does the reflecting.&lt;br /&gt;3) Raise the trust level of the application (I&amp;#39;d recommend against this).&lt;br /&gt;&lt;br /&gt;A table listed in the following post shows that neither WSS_Minimal of WSS_Medium grant the necessary trust level to reflect on other assemblies.&lt;br /&gt;&lt;br /&gt;http://blog.tylerholmes.com/2008/10/don-set-your-sharepoint-app-to-full.html&lt;br /&gt;&lt;br /&gt;Let me know if I&amp;#39;m missing something.&lt;br /&gt;&lt;br /&gt;Best,&lt;br /&gt;Tyler</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/7908127499118919759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/7908127499118919759'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1250283029045#c7908127499118919759' title=''/><author><name>Tyler Holmes</name><uri>http://www.blogger.com/profile/16288716879251803370</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://bp1.blogger.com/_x_KlQTLtnfI/R6e9dSjX4AI/AAAAAAAAAUo/tYqjiMPzf4s/S220/MugShot-Cropped.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1882027894'/></entry><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-4650742847497011451</id><published>2009-08-14T06:57:48.833-07:00</published><updated>2009-08-14T06:57:48.833-07:00</updated><title type='text'>Yes it turns out my solution above is not entirely...</title><content type='html'>Yes it turns out my solution above is not entirely correct. Apparently there is an issue with using LoadControl -- it requires that the PermissionSet tag contains Unrestricted=&amp;quot;true&amp;quot;, which _cannot_ be set in the solution manifest (stsadm throws error about invalid Unrestricted attribute). Read through some of the comments here:&lt;br /&gt;&lt;br /&gt;http://www.dotnetmonster.com/Uwe/Forum.aspx/dotnet-security/2519/SecurityException-Request-failed-in-LoadControl&lt;br /&gt;&lt;br /&gt;One solution is to manually modify the customtrust.config file which is used, and add the Unrestricted=&amp;quot;true&amp;quot;, however whenever the solution is updated, this is removed again. I have not yet found another solution.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/4650742847497011451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/4650742847497011451'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1250258268833#c4650742847497011451' title=''/><author><name>Chris Speck</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1465761796'/></entry><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-600293401577301496</id><published>2009-08-11T10:13:52.459-07:00</published><updated>2009-08-11T10:13:52.459-07:00</updated><title type='text'>Thanks for the reply Chris.

but I am trying to lo...</title><content type='html'>Thanks for the reply Chris.&lt;br /&gt;&lt;br /&gt;but I am trying to load a specific user control.  If you use the code snippet,&lt;br /&gt;&lt;br /&gt;Page.LoadControl(typeof(MyControl), null);&lt;br /&gt;&lt;br /&gt;or &lt;br /&gt;&lt;br /&gt;MyControl myctl = new MyControl();&lt;br /&gt;Page.Controls.Add(myctl);&lt;br /&gt;&lt;br /&gt;How am I going to load the specific control that I want to load?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/600293401577301496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/600293401577301496'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1250010832459#c600293401577301496' title=''/><author><name>Clark</name><uri>http://www.blogger.com/profile/12513733907425124532</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1704588358'/></entry><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-4519383024638518869</id><published>2009-08-11T09:45:39.096-07:00</published><updated>2009-08-11T09:45:39.096-07:00</updated><title type='text'>Seung-Rak

I was getting a very similar error (not...</title><content type='html'>Seung-Rak&lt;br /&gt;&lt;br /&gt;I was getting a very similar error (not sure if it was the same, as it states Request Failed on that same method, but does not specify Security Exception (could not get this info anywhere).&lt;br /&gt;&lt;br /&gt;The line of code which was causing this issue for me was&lt;br /&gt;&lt;br /&gt;Page.LoadControl(&amp;quot;~/controltemplates/mystuff/mycontrol.ascx&amp;quot;);&lt;br /&gt;&lt;br /&gt;I modified this to&lt;br /&gt;&lt;br /&gt;Page.LoadControl(typeof(MyControl), null);&lt;br /&gt;&lt;br /&gt;or &lt;br /&gt;&lt;br /&gt;MyControl myctl = new MyControl();&lt;br /&gt;Page.Controls.Add(myctl);&lt;br /&gt;&lt;br /&gt;And was able to get passed that issue.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/4519383024638518869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/4519383024638518869'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1250009139096#c4519383024638518869' title=''/><author><name>Chris Speck</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-509768243'/></entry><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-3019640535562185363</id><published>2009-06-09T22:11:29.886-07:00</published><updated>2009-06-09T22:11:29.886-07:00</updated><title type='text'>Hey Sung-Rak,
There&amp;#39;s not a tonne of informati...</title><content type='html'>Hey Sung-Rak,&lt;br /&gt;There&amp;#39;s not a tonne of information in that stack trace, do you what it&amp;#39;s trying to construct?&lt;br /&gt;&lt;br /&gt;I&amp;#39;m not even positive this is a code access security exception, usually they look something like:&lt;br /&gt;&lt;br /&gt;Request for the permission of type &lt;br /&gt;  Microsoft.SharePoint.Security.SharePointPermission, &lt;br /&gt;  Microsoft.SharePoint.Security, Version=11.0.0.0, Culture=neutral, &lt;br /&gt;  PublicKeyToken=71e9bce111e9429c failed.&lt;br /&gt;&lt;br /&gt;I would consider slowly deconstructing your page to try and isolate the code/component that is generating this exception.&lt;br /&gt;&lt;br /&gt;Hope that helps.&lt;br /&gt;&lt;br /&gt;Best,&lt;br /&gt;Tyler</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/3019640535562185363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/3019640535562185363'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1244610689886#c3019640535562185363' title=''/><author><name>Tyler Holmes</name><uri>http://www.blogger.com/profile/16288716879251803370</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://bp1.blogger.com/_x_KlQTLtnfI/R6e9dSjX4AI/AAAAAAAAAUo/tYqjiMPzf4s/S220/MugShot-Cropped.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1882027894'/></entry><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-4867330051136788985</id><published>2009-06-09T13:04:23.508-07:00</published><updated>2009-06-09T13:04:23.508-07:00</updated><title type='text'>Thanks for your prompt response, Tyler.  I will be...</title><content type='html'>Thanks for your prompt response, Tyler.  I will be looking at the code, but in the meantime, please see if it is really the code that is generating this problem.&lt;br /&gt;&lt;br /&gt;[SecurityException: Request failed.]&lt;br /&gt;   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&amp;amp; canBeCached, RuntimeMethodHandle&amp;amp; ctor, Boolean&amp;amp; bNeedSecurityCheck) +0&lt;br /&gt;   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86&lt;br /&gt;   System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230&lt;br /&gt;   System.Activator.CreateInstance(Type type, Boolean nonPublic) +67&lt;br /&gt;   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1051&lt;br /&gt;   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111&lt;br /&gt;   System.Web.Configuration.PagesSection.CreateControlTypeFilter() +8704955&lt;br /&gt;   System.Web.UI.PageParserFilter.Create(PagesSection pagesConfig, VirtualPath virtualPath, TemplateParser parser) +13&lt;br /&gt;   System.Web.UI.TemplateParser.ProcessConfigSettings() +224&lt;br /&gt;   System.Web.UI.TemplateControlParser.ProcessConfigSettings() +13&lt;br /&gt;   System.Web.UI.UserControlParser.ProcessConfigSettings() +12&lt;br /&gt;   System.Web.UI.TemplateParser.PrepareParse() +141&lt;br /&gt;   System.Web.UI.TemplateParser.Parse() +167&lt;br /&gt;   System.Web.UI.TemplateParser.Parse(ICollection referencedAssemblies, VirtualPath virtualPath) +34&lt;br /&gt;   System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() +85&lt;br /&gt;   System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) +62&lt;br /&gt;   System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() +199&lt;br /&gt;   System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +42&lt;br /&gt;   System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +8732923&lt;br /&gt;   System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +261&lt;br /&gt;   System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +101&lt;br /&gt;   System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +83&lt;br /&gt;   System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) +48&lt;br /&gt;   System.Web.UI.TemplateControl.LoadControl(String virtualPath) +26&lt;br /&gt;   SharePointHQ.WebPart.AudienceMaster.AudienceMasterWebPart.CreateChildControls() +80&lt;br /&gt;   System.Web.UI.Control.EnsureChildControls() +87&lt;br /&gt;   System.Web.UI.Control.PreRenderRecursiveInternal() +44&lt;br /&gt;   System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() +42&lt;br /&gt;   System.Web.UI.Control.PreRenderRecursiveInternal() +171&lt;br /&gt;   System.Web.UI.Control.PreRenderRecursiveInternal() +171&lt;br /&gt;   System.Web.UI.Control.PreRenderRecursiveInternal() +171&lt;br /&gt;   System.Web.UI.Control.PreRenderRecursiveInternal() +171&lt;br /&gt;   System.Web.UI.Control.PreRenderRecursiveInternal() +171&lt;br /&gt;   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785&lt;br /&gt;   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242&lt;br /&gt;   System.Web.UI.Page.ProcessRequest() +80&lt;br /&gt;   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21&lt;br /&gt;   System.Web.UI.Page.ProcessRequest(HttpContext context) +49&lt;br /&gt;   ASP.DEFAULT_ASPX__82859748.ProcessRequest(HttpContext context) +4&lt;br /&gt;   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181&lt;br /&gt;   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp;amp; completedSynchronously) +75</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/4867330051136788985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/4867330051136788985'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1244577863508#c4867330051136788985' title=''/><author><name>Seung-Rak</name><uri>http://www.blogger.com/profile/12513733907425124532</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1704588358'/></entry><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-8618616396698505490</id><published>2009-06-09T12:56:12.907-07:00</published><updated>2009-06-09T12:56:12.907-07:00</updated><title type='text'>Hey Sung-Rak,

It&amp;#39;s very likely that your cust...</title><content type='html'>Hey Sung-Rak,&lt;br /&gt;&lt;br /&gt;It&amp;#39;s very likely that your custom CAS policy is working correctly...it&amp;#39;s just that there&amp;#39;s other code that is throwing a CAS exception. This information would be in the stack trace.&lt;br /&gt;&lt;br /&gt;I would suggest running your code in a blank site collection if you wanted to test your own CAS policy.&lt;br /&gt;OR&lt;br /&gt;Stare intently at the stack trace and try to discern what code is throwing the exception. If you can find out which assembly is responsible for the CAS exception then you can have it run in full trust by modifying your custom CAS policy.&lt;br /&gt;&lt;br /&gt;You can extract public keys from signed assemblies for which you don&amp;#39;t have the .snk by running sn -Tp [assemblyname].&lt;br /&gt;&lt;br /&gt;Hope that helps.&lt;br /&gt;&lt;br /&gt;My Best,&lt;br /&gt;Tyler</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/8618616396698505490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/8618616396698505490'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1244577372907#c8618616396698505490' title=''/><author><name>Tyler Holmes</name><uri>http://www.blogger.com/profile/16288716879251803370</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://bp1.blogger.com/_x_KlQTLtnfI/R6e9dSjX4AI/AAAAAAAAAUo/tYqjiMPzf4s/S220/MugShot-Cropped.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1882027894'/></entry><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-6142050350025779366</id><published>2009-06-09T09:27:58.656-07:00</published><updated>2009-06-09T09:27:58.656-07:00</updated><title type='text'>Hi Tyler,

After I followed the same steps describ...</title><content type='html'>Hi Tyler,&lt;br /&gt;&lt;br /&gt;After I followed the same steps described, that is, as soon as I replaced &amp;quot;Full&amp;quot; with &amp;quot;WSS_Custom&amp;quot;, I complete lost access to the portal with this error below:&lt;br /&gt;&lt;br /&gt;Server Error in &amp;#39;/&amp;#39; Application.&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Security Exception &lt;br /&gt;Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application&amp;#39;s trust level in the configuration file. &lt;br /&gt;&lt;br /&gt;Exception Details: System.Security.SecurityException: Request failed.&lt;br /&gt;&lt;br /&gt;Source Error: &lt;br /&gt;&lt;br /&gt;The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:&lt;br /&gt;&lt;br /&gt;1. Add a &amp;quot;Debug=true&amp;quot; directive at the top of the file that generated the error. &lt;br /&gt;&lt;br /&gt;or:&lt;br /&gt;&lt;br /&gt;2) Add the following section to the configuration file of your application:&lt;br /&gt;&lt;br /&gt;Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.&lt;br /&gt;&lt;br /&gt;Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.  &lt;br /&gt;&lt;br /&gt;(i excluded stack trace because it exceeded the number of characters allowed)&lt;br /&gt;&lt;br /&gt;Is there any other step or configuration that must have been arranged?  Any opinion would be appreciated.&lt;br /&gt;&lt;br /&gt;Thanks.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/6142050350025779366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/6142050350025779366'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1244564878656#c6142050350025779366' title=''/><author><name>Seung-Rak</name><uri>http://www.blogger.com/profile/12513733907425124532</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1704588358'/></entry><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-1983389365311349152</id><published>2008-12-18T23:03:00.000-08:00</published><updated>2008-12-18T23:03:00.000-08:00</updated><title type='text'>You're right Malcolm, your assemblies are indeed r...</title><content type='html'>You're right Malcolm, your assemblies are indeed running in full trust. The problem is your web application isn't (it's probably still in WSS_Minimal/WSS_Medium).&lt;BR/&gt;&lt;BR/&gt;When code that isn't running in full trust makes calls to code that IS running in full trust there's a risk that the calling code is luring the called assembly in to doing something malicious on it's behalf. &lt;BR/&gt;&lt;BR/&gt;If you're sure this isn't a risk, then you can put the AllowPartiallyTrustedCallers attribute on your assembly.&lt;BR/&gt;&lt;BR/&gt;There's more info on APTCA here (http://blogs.msdn.com/shawnfa/archive/2005/02/04/367390.aspx)&lt;BR/&gt;&lt;BR/&gt;Best,&lt;BR/&gt;Tyler</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/1983389365311349152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/1983389365311349152'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1229670180000#c1983389365311349152' title=''/><author><name>Tyler Holmes</name><uri>http://www.blogger.com/profile/16288716879251803370</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://bp1.blogger.com/_x_KlQTLtnfI/R6e9dSjX4AI/AAAAAAAAAUo/tYqjiMPzf4s/S220/MugShot-Cropped.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1882027894'/></entry><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-8551566026933823542</id><published>2008-12-18T19:15:00.000-08:00</published><updated>2008-12-18T19:15:00.000-08:00</updated><title type='text'>Hi Tyler&lt;br&gt;&lt;br&gt;Great article, thanks!&lt;br&gt;&lt;br&gt;I se...</title><content type='html'>Hi Tyler&lt;BR/&gt;&lt;BR/&gt;Great article, thanks!&lt;BR/&gt;&lt;BR/&gt;I seem to keep running into the issue of safe controls when I sign my assembly. I had an unsigned web part, deploying to the bin directory and it worked fine. I had need to use LINQ in the web part and trust was set to full. I followed the steps in your article to get away from having trust set to full - it all seemed to make sense and I got everything done. Now, when I try and place the web part on the page I get a messagebox saying that assemblies that implement ASP.Net web parts and are installed in a partially trusted location such as the bin directory must be compiled with AllowPartiallyTrustedCallersAttribute set for import to succeed.&lt;BR/&gt;&lt;BR/&gt;Does this make sense? I thought this assembly was now trusted as a result of the changes made to the CAS config. Any thoughts?&lt;BR/&gt;&lt;BR/&gt;Thanks&lt;BR/&gt;&lt;BR/&gt;Malcolm</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/8551566026933823542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/8551566026933823542'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1229656500000#c8551566026933823542' title=''/><author><name>Malcolm</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1620167494'/></entry><entry><id>tag:blogger.com,1999:blog-8451123064758809734.post-8599793496944818320</id><published>2008-12-08T05:12:00.000-08:00</published><updated>2008-12-08T05:12:00.000-08:00</updated><title type='text'>great post! Thanks</title><content type='html'>great post! Thanks</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/8599793496944818320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8451123064758809734/1900543564598099122/comments/default/8599793496944818320'/><link rel='alternate' type='text/html' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html?showComment=1228741920000#c8599793496944818320' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.tylerholmes.com/2008/11/creating-custom-cas-policy-file-for.html' ref='tag:blogger.com,1999:blog-8451123064758809734.post-1900543564598099122' source='http://www.blogger.com/feeds/8451123064758809734/posts/default/1900543564598099122' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2116595568'/></entry></feed>
