Search This Blog

Monday, December 15, 2014

Assembly Class C# Example

C# > System > Reflection > Assembly

Assembly class:

  • load assemblies
  • explore the metadata 
  • find the types contained in assemblies and to create instances of those types.




Example


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication27
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Assembly a = typeof(Form1).Assembly;
            MessageBox.Show(a.FullName);
        }
    }
}