• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

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

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?


1 Solution

using System.Reflection
justricAuthor Commented:
Thank you.

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Tackle projects and never again get stuck behind a technical roadblock.
Join Now