Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1101905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:06:09+00:00 2026-05-17T01:06:09+00:00

In a shell application, I need to be able to load and execute other

  • 0

In a shell application, I need to be able to load and execute other .NET assemblies at runtime, but without giving them full trust. Essentially, I want to limit them (the loaded assemblies) from touching any system resources (threading, networking, etc), with the only exception being isolated storage. However, assemblies which are from “me” need to be executed with full trust.

I’ve been considering Code Access Security, but I’m not quite sure it’s what I should use.

How would you go about this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:06:10+00:00Added an answer on May 17, 2026 at 1:06 am

    CAS is pretty much what you need here. More specifically, you want to load the assembly in its own Application Domain:

    var myEvidence = new Evidence(new object[] {SecurityZone.Internet});
    var newDomain = AppDomain.CreateDomain("InternetDomain");
    myDomain.Load("MyUntrustedAssembly.dll", myEvidence);
    myDomain.CreateInstanceAndUnwrap("MyUntrustedAssembly","MyUntrustedObjectType");
    
    //do your work with the untrusted assembly/type
    
    AppDomain.Unload(myDomain);
    

    Read up on Application Domains, the various zones, and the default permission sets assigned to them. Internet is the most restrictive of the system-defined zones/permission sets available in which assemblies can still actually execute (there’s also the Restricted zone; assemblies falling into this zone cannot run). You can use the .NET Configuration tool to create permission sets and define the conditions (evidence) that code must satisfy to be granted the permission set.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We need to make our enterprise ASP.NET/NHibernate browser-based application able to function when connected
I have a small shell application that embeds Tcl to execute some set of
From an ASP.Net C# application I need to access the 'Title' property value from
From an ASP.Net C# application I need to access the 'Title' property value from
For my web application running on LAMP, I need to be able to deploy
I have an ASP.NET MVC2 application where I need to support not only multiple
I have an application where users are able to upload pictures in albums but
Summary I have looked over the code the SpiderMonkey 'shell' application uses to create
I inherited a shell-script application that is a combination of kshell scripts, awk, and
Our application has a couple of shell scripts that are called from web-based Oracle

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.