exception classes

  • Thread starter Thread starter Mike P
  • Start date Start date
M

Mike P

I have created my own very simple exception classes e.g

using System;

namespace WebApplication90
{
public class AddressException : ApplicationException
{
public AddressException()
{
}
}
}

I now want to make DLLs for each of my exceptions so I can add them to
different projects. But when I make a DLL and reference it and include
the exception in my code I get 'must be derived from System.Exception'
errors (this happens whether I derive my exception class from Exception
or ApplicationException).

Does anybody know what I'm doing wrong?


Cheers,

Mike
 
That should work fine. App code should look like below. Did you reference
the dll?
using System;



using WebApplication90;

namespace WebApplication90 {

class Program {

static void Main(string[] args) {

AddressException e = new AddressException();

}

}

}
 
Back
Top