Search this blog

You can search for all the topics in our blog using our google custom search now.

Search the blog

Loading

Wednesday, July 21, 2010

Application Domain Tutorial Part 1

CREATING APPLICATION DOMAINS
--------------------------------------------

Video tutorial part-1




Video tutorial part-2




Application Domain:

An application domain is a logical container that allows multiple assemblies to run within a single process.Each application domain can be configured with different security access levels.

In our example we will create a simple application and then we will try to run this application within a domain that we will create.So first create an application and then we will create an application domain.
First create a hello world application like this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("This is a hello world application running an application domain");
Console.ReadKey();
}
}
}

Once you created an application.You can run this application under a particular domain. In our example we will start another console application and create an application domain. We can run any application or assemblies by providing the path of assembly/exe file in ExecuteAssembly Method as follows:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Policy;


namespace AppdomainEx1
{
    class Program
    {
        static void Main(string[] args)
        {
        


            AppDomain d = AppDomain.CreateDomain("HelloWorldDomain");
            d.ExecuteAssembly(@"C:\Users\Owner\Documents\Visual Studio 2008\Projects\HelloWorld\HelloWorld\bin\Debug\HelloWorld.exe");
        
            AppDomain.Unload(d);
        }
    }
}


Will be uploading the video tutorials on this in a while.

Regards
Sameer Shaik

Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net.

1 comment:

  1. Great! You are doing a great and exelent job.

    ReplyDelete