By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,724 Members | 863 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,724 IT Pros & Developers. It's quick & easy.

Server Side custom exception

P: n/a
Hi all,

I had created a Remoting Custom Exception that inherits from System.Exception.
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 DbActionException : Exception
{
public DbActionException() : base()
{ }
public DbActionException(string message)
: base(message)
{ }
public DbActionException(string message, System.Exception inner)
: base(message, inner)
{ }
protected DbActionException(SerializationInfo info, StreamingContext
context)
: base(info, context)
{ }
public override void GetObjectData(SerializationInfo info,
StreamingContext context)
{
base.GetObjectData(info, context);
}
}
// in DAL Layer

try{ //Do somethings }
catch(Exception ex)
{
throw new DbActionException(ex.ToString());
}

// in Service Layer

try{ //Do somethings }
catch(DbActionException ex)
{
throw ex;
}

// in UI Layer

try{ //Do somethings }
catch(DbActionException ex)
{
ExceptionPolicy.HandleException(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=<version>... or one of its dependencies.
The system cannot find the file specified.":"<name>, Version=<version>...
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,

Aug 10 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi all,

Any solution?

Thanks for any reply!

Regards,
problemKing wrote:
>Hi all,

I had created a Remoting Custom Exception that inherits from System.Exception.
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 DbActionException : Exception
{
public DbActionException() : base()
{ }
public DbActionException(string message)
: base(message)
{ }
public DbActionException(string message, System.Exception inner)
: base(message, inner)
{ }
protected DbActionException(SerializationInfo info, StreamingContext
context)
: base(info, context)
{ }
public override void GetObjectData(SerializationInfo info,
StreamingContext context)
{
base.GetObjectData(info, context);
}
}

// in DAL Layer

try{ //Do somethings }
catch(Exception ex)
{
throw new DbActionException(ex.ToString());
}

// in Service Layer

try{ //Do somethings }
catch(DbActionException ex)
{
throw ex;
}

// in UI Layer

try{ //Do somethings }
catch(DbActionException ex)
{
ExceptionPolicy.HandleException(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=<version>... or one of its dependencies.
The system cannot find the file specified.":"<name>, Version=<version>...
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,
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...sharp/200608/1

Aug 14 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.