Hi all,
I had created a Remoting Custom Exception that inherits from System.Exceptio n.
Now, i meet the same problem that has been posted by previous thread
http://www.dotnetmonster.com/Uwe/For...stom-exception
Below is the coding that i wrote,
// Remoting Custom Exception
[Serializable]
public class DbActionExcepti on : Exception
{
public DbActionExcepti on() : base()
{ }
public DbActionExcepti on(string message)
: base(message)
{ }
public DbActionExcepti on(string message, System.Exceptio n inner)
: base(message, inner)
{ }
protected DbActionExcepti on(Serializatio nInfo info, StreamingContex t
context)
: base(info, context)
{ }
public override void GetObjectData(S erializationInf o info,
StreamingContex t context)
{
base.GetObjectD ata(info, context);
}
}
// in DAL Layer
try{ //Do somethings }
catch(Exception ex)
{
throw new DbActionExcepti on(ex.ToString( ));
}
// in Service Layer
try{ //Do somethings }
catch(DbActionE xception ex)
{
throw ex;
}
// in UI Layer
try{ //Do somethings }
catch(DbActionE xception ex)
{
ExceptionPolicy .HandleExceptio n(ex, "LoggingPolicy" )
}
The problem is - in my UI layer (client side), it requests for server layer's
assembly. If i didn't add the service layer assembly, the error of Could not
load file or assembly <name>, Version=<versio n>... or one of its dependencies.
The system cannot find the file specified.":"<n ame>, Version=<versio n>...
If i added the service layer assembly, this error won't occur and the
exception is succeed to log. But as everyone knows that it is make sense that
service layer dll cannot be added at UI layer right?
Do anyone have the solution?
Thanks for any reply!
Regards,