{"id":1693,"date":"2009-06-10T21:56:00","date_gmt":"2009-06-10T21:56:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/dotnet\/2009\/06\/10\/new-security-model-moving-to-a-better-sandbox\/"},"modified":"2021-10-04T15:15:28","modified_gmt":"2021-10-04T22:15:28","slug":"new-security-model-moving-to-a-better-sandbox","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/new-security-model-moving-to-a-better-sandbox\/","title":{"rendered":"New Security Model: Moving to a Better Sandbox"},"content":{"rendered":"<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\"><\/font><\/font>&nbsp;<\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">For .Net Framework 4, we decided to remove the dependency on caspol and the policy levels and&nbsp;make things simpler. <\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">With this change, the default grant-set for assemblies is now FullTrust<span> unless the host (such as&nbsp;InternetExplorer) decides to load them in a sanbox. We also made CodeAccessPermission.Deny obsolete. This <\/span><\/font><\/font><a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkId=151964\"><span><font color=\"#0000ff\" face=\"Calibri\">MSDN article<\/font><\/span><\/a><span><font face=\"Calibri\"> describes the changes we made in the security namespace for .Net Framework 4 in detail. <\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">For most people, this change in policy will be unnoticeable, their program probably was already running in full-trust and the world is the same. For some others, things will be a lot easier: launching their tool from the companies&rsquo; intranet share is now possible without the need to change the .Net Framework policy. For an even smaller set of users, there will be some issues that they will encounter, they were probably expecting assemblies to be loaded as partial trust and now they are full-trust. <\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\"><\/p>\n<p><\/font><\/span>&nbsp;<\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">In this post, we will cover how programs can be migrated to the newer security model and still work in the way they were intended to work.<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">In versions of .Net Framework before v4, we had many ways to restrict the permissions of an assembly or even certain code path within the assembly:<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">1.<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Stack-walk modifiers: Deny, PermitOnly<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">2.<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Assembly-level requests: RequestOptional, RequestRefuse, RequestMinimum<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">3.<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Policy changes: caspol, and AppDomain.SetPolicyLevel<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">4.<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Loading an assembly with a Zone other than MyComputer <\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">In the past, these APIs have been a source of confusion for host and application writers. In .Net Framework 4, these methods of restricting permissions are marked obsolete and we hope to remove them at a point in the future. The .Net Framework 4 throws NotSupportedException when encountering calls to functions allowing any of these sandboxing methods. Applications that used these sandboxing APIs will now see an exception similar to this:<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><b><span><font face=\"Calibri\">System.NotSupportedException: The Deny stack modifier has been obsoleted by the .NET Framework.<span>&nbsp; <\/span>Please see <\/font><a href=\"http:\/\/go2.microsoft.com\/fwlink\/?LinkId=131738\"><font color=\"#0000ff\" face=\"Calibri\">http:\/\/go2.microsoft.com\/fwlink\/?LinkId=131738<\/font><\/a><font face=\"Calibri\"> for more information.<\/p>\n<p><\/font><\/span><\/b><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">Here is what you can do, after identifying that your code uses one of the previously described sandboxing methods:<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><span>1.<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><span>Execute the partial trust code inside a partial-trust AppDomains. This approach might appear difficult because it asks you to figure out what trust levels your application needs. Having part of your application running in another AppDomain also requires some consideration about how to do the communication with the objects residing in the new AppDomain. This model might be more complex than just a command that changes the machine policy, but we think it is a better one. This <\/span><span><a href=\"http:\/\/blogs.msdn.com\/shawnfa\/archive\/2006\/04\/19\/579066.aspx\"><span><font color=\"#0000ff\">article<\/font><\/span><\/a><\/span><span> provides more information about why this sandboxing strategy is better.<\/p>\n<p><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><font size=\"3\"><font face=\"Times New Roman\">Here are the steps for creating a new sandboxing AppDomain:<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><font face=\"Times New Roman\"><span><font size=\"3\">1.1.<\/font><span>&nbsp;&nbsp; <\/span><\/span><span><font size=\"3\">Remove the Deny, assembly level requests or the caspol command from your application.<\/p>\n<p><\/font><\/span><\/font><\/p>\n<p class=\"MsoListParagraph\"><font face=\"Times New Roman\"><span><font size=\"3\">1.2.<\/font><span>&nbsp;&nbsp; <\/span><\/span><span><font size=\"3\">Create a new partial-trust AppDomain with a partial-trust grant set. This is done by calling the override for AppDomain.CreateDomain that receives a grant-set and a full-trust StrongName list:<\/p>\n<p><\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\"><span>public<\/span> <span>static<\/span> <\/font><\/font><a title=\"System.AppDomain\" href=\"http:\/\/www.aisto.com\/roeder\/dotnet\/Default.aspx?Target=code:\/\/mscorlib:4.0.0.0:b77a5c561934e089\/System.AppDomain\"><font color=\"#0000ff\" size=\"3\" face=\"Calibri\">AppDomain<\/font><\/a><font size=\"3\" face=\"Calibri\"> <\/font><a href=\"http:\/\/www.aisto.com\/roeder\/dotnet\/Default.aspx?Target=code:\/\/mscorlib:4.0.0.0:b77a5c561934e089\/System.AppDomain\/CreateDomain(String,System.Security.Policy.Evidence,System.AppDomainSetup,System.Security.PermissionSet,System.Security.Policy.StrongName%5b%5d):System.AppDomain\"><b><font color=\"#0000ff\" size=\"3\" face=\"Calibri\">CreateDomain<\/font><\/b><\/a><font size=\"3\" face=\"Calibri\">(<\/font><a title=\"System.String\" href=\"http:\/\/www.aisto.com\/roeder\/dotnet\/Default.aspx?Target=code:\/\/mscorlib:4.0.0.0:b77a5c561934e089\/System.String\"><font color=\"#0000ff\" size=\"3\" face=\"Calibri\">string<\/font><\/a><font size=\"3\" face=\"Calibri\"> friendlyName, <\/font><a title=\"System.Security.Policy.Evidence\" href=\"http:\/\/www.aisto.com\/roeder\/dotnet\/Default.aspx?Target=code:\/\/mscorlib:4.0.0.0:b77a5c561934e089\/System.Security.Policy.Evidence\"><font color=\"#0000ff\" size=\"3\" face=\"Calibri\">Evidence<\/font><\/a><font size=\"3\" face=\"Calibri\"> securityInfo, <\/font><a title=\"System.AppDomainSetup\" href=\"http:\/\/www.aisto.com\/roeder\/dotnet\/Default.aspx?Target=code:\/\/mscorlib:4.0.0.0:b77a5c561934e089\/System.AppDomainSetup\"><font color=\"#0000ff\" size=\"3\" face=\"Calibri\">AppDomainSetup<\/font><\/a><font size=\"3\" face=\"Calibri\"> info, <\/font><a title=\"System.Security.PermissionSet\" href=\"http:\/\/www.aisto.com\/roeder\/dotnet\/Default.aspx?Target=code:\/\/mscorlib:4.0.0.0:b77a5c561934e089\/System.Security.PermissionSet\"><font color=\"#0000ff\" size=\"3\" face=\"Calibri\">PermissionSet<\/font><\/a><font size=\"3\" face=\"Calibri\"> grantSet, <span>params<\/span> <\/font><a title=\"System.Security.Policy.StrongName\" href=\"http:\/\/www.aisto.com\/roeder\/dotnet\/Default.aspx?Target=code:\/\/mscorlib:4.0.0.0:b77a5c561934e089\/System.Security.Policy.StrongName\"><font color=\"#0000ff\" size=\"3\" face=\"Calibri\">StrongName<\/font><\/a><font size=\"3\" face=\"Calibri\">[] fullTrustAssemblies)<\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\" face=\"Calibri\">The MSDN article talking about this specific override is located <\/font><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms130766.aspx\"><font color=\"#0000ff\" size=\"3\" face=\"Calibri\">here<\/font><\/a><\/p>\n<p class=\"MsoNormal\"><font size=\"3\" face=\"Calibri\">This would create a new AppDomain which would give assemblies by default the PermissionSet given as a parameter. Assemblies that have their StrongName present in the fullTrustAssemblies parameter, will receive FullTrust as the grant-set.<\/font><\/p>\n<p class=\"MsoListParagraph\"><font face=\"Times New Roman\"><span><font size=\"3\">1.3.<\/font><span>&nbsp;&nbsp; <\/span><\/span><span><font size=\"3\">Create an instance of one of your classes inside the new AppDomain. Your class would have to inherit from MarshalByRefObject. The API to use is this: <\/p>\n<p><\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\"><span>public<\/span> <\/font><\/font><a title=\"System.Object\" href=\"http:\/\/www.aisto.com\/roeder\/dotnet\/Default.aspx?Target=code:\/\/mscorlib:4.0.0.0:b77a5c561934e089\/System.Object\"><font color=\"#0000ff\" size=\"3\" face=\"Calibri\">object<\/font><\/a><font size=\"3\" face=\"Calibri\"> <\/font><a href=\"http:\/\/www.aisto.com\/roeder\/dotnet\/Default.aspx?Target=code:\/\/mscorlib:4.0.0.0:b77a5c561934e089\/System.AppDomain\/CreateInstanceAndUnwrap(String,String):Object\"><b><font color=\"#0000ff\" size=\"3\" face=\"Calibri\">CreateInstanceAndUnwrap<\/font><\/b><\/a><font size=\"3\" face=\"Calibri\">(<\/font><a title=\"System.String\" href=\"http:\/\/www.aisto.com\/roeder\/dotnet\/Default.aspx?Target=code:\/\/mscorlib:4.0.0.0:b77a5c561934e089\/System.String\"><font color=\"#0000ff\" size=\"3\" face=\"Calibri\">string<\/font><\/a><font size=\"3\" face=\"Calibri\"> assemblyName, <\/font><a title=\"System.String\" href=\"http:\/\/www.aisto.com\/roeder\/dotnet\/Default.aspx?Target=code:\/\/mscorlib:4.0.0.0:b77a5c561934e089\/System.String\"><font color=\"#0000ff\" size=\"3\" face=\"Calibri\">string<\/font><\/a><font size=\"3\" face=\"Calibri\"> typeName)<\/font><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">The MSDN article talking about this specific override is located <\/font><\/span><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.appdomain.createinstanceandunwrap.aspx\"><span><font color=\"#0000ff\" face=\"Calibri\">here<\/font><\/span><\/a><span><font face=\"Calibri\">.<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">This API will return you a reference of type object to an instance of a class inside the new AppDomain. You would have to convert that instance to your specific type, so you would be able to call functions present in your class on it.<\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><font face=\"Times New Roman\"><span><font size=\"3\">1.4.<\/font><span>&nbsp;&nbsp; <\/span><\/span><span><font size=\"3\">Call a function on your newly created instance. This function call would be marshaled across AppDomain boundaries and will be executing in the new AppDomain, thus in partial trust. <\/p>\n<p><\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">Example:<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span>PermissionSet<\/span><span> ps = <span>new<\/span> <span>PermissionSet<\/span>(<span>PermissionState<\/span>.None);<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>ps.AddPermission(<span>new<\/span> <span>SecurityPermission<\/span>(<span>SecurityPermissionFlag<\/span>.Execution));<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>\/\/Create a new sandboxed domain <\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>AppDomainSetup<\/span><span> setup = <span>AppDomain<\/span>.CurrentDomain.SetupInformation;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>AppDomain<\/span><span> newDomain = <span>AppDomain<\/span>.CreateDomain(<span>&#8220;test domain&#8221;<\/span>, <span>null<\/span>, setup, ps);<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>\/\/Create an instance in the new domain. <\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>\/\/The class has to derive from MarshalByRefObject. We consider <\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>\/\/PartialTrustTest to be such a class<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>PartialTrustTest remoteTest = newDomain.CreateInstanceAndUnwrap(<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>typeof<\/span>(PartialTrustTest).Assembly.FullName, <\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;<\/span><span>&nbsp;&nbsp; <\/span><span>typeof<\/span>(PartialTrustTest).FullName) <span>as<\/span> PartialTrustTest;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>remoteTest.EntryPoint();<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font face=\"Calibri\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">This will get slightly more complicated if you would have 2 assemblies, where one needs to be run in FullTrust and one in PartialTrust. The way to do this is to sign with a key (obtained by caling sn &ndash;k) the FullTrust assembly, and pass it&rsquo;s strong name as the last parameter to AppDomain.CreateDomain.<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">Example:<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">&hellip;<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span>\/\/We consider FullTrustAssm to be the name of the assembly that needs to be<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>\/\/executed as a full-trust assembly<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>AppDomain<\/span><span> newDomain = <span>AppDomain<\/span>.CreateDomain(<span>&#8220;test domain&#8221;<\/span>, <span>null<\/span>, setup, ps, <\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>Assembly<\/span><span>.Load(<span>&#8220;FullTrustAssm&#8221;<\/span>).Evidence.GetHostEvidence&lt;<span>StrongName<\/span>&gt;());<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">&hellip;<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><font face=\"Times New Roman\"><span><font size=\"3\">2.<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><span><font size=\"3\">Sandboxing AppDomains might seem complicated and daunting, especially if all you need is to launch an entire executable in PartialTrust and you don&rsquo;t want to know all the details of AppDomain creation and communication.<\/p>\n<p><\/font><\/span><\/font><\/p>\n<p class=\"MsoListParagraph\"><font size=\"3\"><font face=\"Times New Roman\"><span>If this is the case, we recommend the <\/span>PTRunner<span> tool. If you are going to take this route, you still need to remove the Deny, assembly level requests or the caspol command. In order to be able to use this tool, your application has to be launched from the command prompt. The tool is present in the CLR Security codeplex site at project <\/span><\/font><\/font><a href=\"http:\/\/clrsecurity.codeplex.com\/Release\/ProjectReleases.aspx?ReleaseId=28359\"><span><font color=\"#0000ff\" size=\"3\" face=\"Times New Roman\">PTRunner<\/font><\/span><\/a><span><font size=\"3\"><font face=\"Times New Roman\">. <\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><font size=\"3\"><font face=\"Times New Roman\"><span>So let&rsquo;s say your test is located in one assembly called &ldquo;partialTrustAssembly.exe&rdquo; that used to have Deny. You remove the deny and call <\/span>PTRunner<span>. Under the covers the <\/span>PTRunner <span>tool sets a sandbox AppDomain for you and launches your application in it.<\/p>\n<p><\/span><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">Example: <\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">PTRunner partialTrustAssembly.exe<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">Now let&rsquo;s say, you want one of the assemblies your executable references to be full trust. You would do something like this:<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">PTRunner &ndash;af fullTrustAssembly.dll partialTrustAssembly.exe<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">You could also do something like this.<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">PTRunner &ndash;af FullTrustAssembly.exe FullTrustAssembly.exe . <\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">This is rather fancy but it runs your assembly as full trust in a partial trust AppDomain. This would allow you to do operations allowed only to full-trust code, like assert, but at the same time run in a partiual-trust AppDomain so demands would still fail.<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">Or perhaps you don&rsquo;t like the minimum execution permission that your assembly is run under. You could do something like this:<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">PTRunner &ndash;ps Internet partialTrustAssembly.exe<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">Or perhaps you want your very own permission set that is non-standard. You would write the permission in XML and call PTRunner like this:<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">PTRunner &ndash;xml Permission.xml partialTrustAssembly.exe<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">The xml file contains the serialization to XML of a permission set.<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><font face=\"Times New Roman\"><span><font size=\"3\">3.<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><span><font size=\"3\">If you don&rsquo;t have the luxury to launch a runner that, in turn, launches your test, another way to launch code in partial-trust is to use the SandboxActivator. This is located in the <\/font><\/span><\/font><a href=\"http:\/\/clrsecurity.codeplex.com\/\"><span><font color=\"#0000ff\" size=\"3\" face=\"Times New Roman\">CLR Security codeplex site<\/font><\/span><\/a><span><font size=\"3\" face=\"Times New Roman\"> in the <\/font><\/span><a href=\"http:\/\/clrsecurity.codeplex.com\/Release\/ProjectReleases.aspx?ReleaseId=28364\"><span><font color=\"#0000ff\" size=\"3\" face=\"Times New Roman\">Security 1.1<\/font><\/span><\/a><span><font size=\"3\"><font face=\"Times New Roman\"> library and will help you set up a new AppDomain in an easier way. This is basically a wrap around ApDomain.CreateDomain and AppDomain. CreateInstanceAndUnwrap from the example above about sandboxed domains and it returns you just an instance of your type in the new AppDomain. <\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoListParagraph\"><span><font size=\"3\"><font face=\"Times New Roman\">You still need to remove the Deny, assembly level requests or the caspol command from your application and make one of the existing classes derive from MarshalByRefObject. Then you call the SandboxActivator.GetPartialTrustInstance which will return a new instance of your type in a partial-trust AppDomain. Calling a method on this new instance will be executed in a partial-trust sandbox.<\/p>\n<p><\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">Example:<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span>\/\/This will create a sandboxed AppDomain with the Execution permission set <\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>MainClass m = SandboxActivator.GetPartialTrustInstance&lt;MainClass&gt;();<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>m.DoPartialTrustCall();<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\"><span>&nbsp; <\/span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font face=\"Calibri\">Th<\/font><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; For .Net Framework 4, we decided to remove the dependency on caspol and the policy levels and&nbsp;make things simpler. With this change, the default grant-set for assemblies is now FullTrust unless the host (such as&nbsp;InternetExplorer) decides to load them in a sanbox. We also made CodeAccessPermission.Deny obsolete. This MSDN article describes the changes we [&hellip;]<\/p>\n","protected":false},"author":342,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685],"tags":[],"class_list":["post-1693","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet"],"acf":[],"blog_post_summary":"<p>&nbsp; For .Net Framework 4, we decided to remove the dependency on caspol and the policy levels and&nbsp;make things simpler. With this change, the default grant-set for assemblies is now FullTrust unless the host (such as&nbsp;InternetExplorer) decides to load them in a sanbox. We also made CodeAccessPermission.Deny obsolete. This MSDN article describes the changes we [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/1693","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/342"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=1693"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/1693\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=1693"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=1693"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=1693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}