473,394 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Server Side custom exception

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
1 2168
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Ken Allen | last post by:
I have a .net client/server application using remoting, and I cannot get the custom exception class to pass from the server to the client. The custom exception is derived from ApplicationException...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
2
by: Barbara Alderton | last post by:
I setup some standard Required Field Validation controls and one Custom validation control on an ASP.NET page (within a user control) to validate text entry. I also setup a Summary Control to post...
3
by: The Developer | last post by:
Hi All, I have a web application where I am adding a custom attribute to my ASP.NET text box control and changing value of that attribute at client side using JavaScript. My problem is that...
8
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really...
2
by: escristian | last post by:
I created a Custom Exception that inherits from ApplicationException. This is declared in an assembly that is on the server side. I made this class serializable and overloaded all the necessary...
4
by: David Lozzi | last post by:
Howdy, I found a nice little book called ASP.NET 2.0 Cookbook by Michael A Kittel and Geoffrey LeBlond. Anyway, they have some instructions on how to setup application level error handling. Most...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
2
by: Scott | last post by:
I'm debugging an xmlrpc client/server application. Often when an exception occurs in the server, I receive only a very short error message on the client. For example: xmlrpclib.Fault: <Fault 1:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.