private static Assembly - type or namespace 'not found' when compiling

Posted on 2011-10-27
Last Modified: 2013-12-16
I am a relative newbie to C# programming (Visual Studio 2010). I am looking at some sample code and getting a compile error that seems fundamental, but the solution has so far eluded me.

In the main method, this is the first line of code:

   AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

Then, there is a private method that starts like this:

    private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)

When I attempt to compile the code, the only error that occurs, presumably because it is the first one encountered and is fatal, is this:

   "The type or namespace name 'Assembly' could not be found (are you missing a using directive or an assembly reference?)"

The using statements are:

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

I believe those are the default references added when I started a new project, into which I pasted the sample code.

I think the issue with the  'not found' Assembly reference must be some basic error with my Visual Studio configuration or perhaps I need some additional using statements. I have searched quite a bit for some kind of clue or answer, but have not been able to figure it out. Does anyone have an idea of what might be causing this issue?


Question by:justric
    LVL 16

    Accepted Solution


    using System.Reflection

    Author Closing Comment

    Thank you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    testing for null fails in 3 29
    Wordmerge 8 30 check for multiple values 5 29
    What is MicroStrategy.NET? 2 21
    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now