Saqib Ullah

BootStrapper Know How

  Home  |   Contact  |   Syndication    |   Login
  109 Posts | 1 Stories | 820 Comments | 15 Trackbacks

News



Article Categories

Archives

Post Categories

Blogging websites

Favourite Blogs

Private Links

Sites

We had a Situation when we want to check different binaries files for managed assembly. In our case we had more than 100 files in which 50 of them are .Net assembles and we want to check all of them and load all of .Net assemblies for verification. The very common approach that comes in our mind is AppDomain. But the problem with AppDomain.CurrentDomain is that it not unload the loaded assemble from current AppDomain and keep in mind that we had around 50 .net assembles that we need to check.

Here is come a very handy utility I found in Microsoft.Build.Tasks.dll

 

        public bool FileIsAssembly(string assemblyName)

        {

            bool _loadAss = false;

            AssemblyIdentity identity = null;

            try

            {

              identity = AssemblyIdentity.FromFile(assemblyName);

 

              if (identity != null)

                  _loadAss = true;               

            }

            catch (Exception ex)

            { }

            return _loadAss;

        }

 

Enjoy geeks...

Assemble is not load in Current AppDomain so no need to unload that.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted on Thursday, August 06, 2009 5:30 AM

Feedback

# re: Load .Net Assembly without loading it in AppDomain 11/13/2009 12:16 AM Varun
What exactly can you do once you have obtained the AssemblyIdentity. I mean is there any other practical use for the same.

# re: Load .Net Assembly without loading it in AppDomain 3/9/2011 11:30 PM eve isk
Optimists always picture themselves accomplishing their goals.

# re: Load .Net Assembly without loading it in AppDomain 6/13/2011 5:54 AM Aslam
Your post is informative.send gifts to pakistan

# re: Load .Net Assembly without loading it in AppDomain 12/18/2011 6:36 PM cocktail dresses 2011
It is possible to even generate your personal styles for making the bridesmaid wedding dresses; if which is the case then you definitely really should get a quote value before hand.

# re: Load .Net Assembly without loading it in AppDomain 12/24/2011 8:02 AM asbestos Management
So nice and helping post.

# re: Load .Net Assembly without loading it in AppDomain 12/27/2011 12:49 AM blackberry spy app
The post is written in very a good manner and it contains many useful information for me. You have a very impressive writing style. Thanks for sharing.Keep up the Great work Thanks for your time and effort

# re: Load .Net Assembly without loading it in AppDomain 12/29/2011 5:29 AM Blackberry Spy
The blog was absolutely fantastic! Lot of great information which can be helpful in some or the other way. Keep updating the blog,looking forward for more contents...Great job, keep it up..

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: