473,566 Members | 3,309 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Server Side custom exception

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,

Aug 10 '06 #1
1 2184
Hi all,

Any solution?

Thanks for any reply!

Regards,
problemKing wrote:
>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,
StreamingConte xt context)
{
base.GetObjectD ata(info, context);
}
}

// in DAL Layer

try{ //Do somethings }
catch(Exceptio n ex)
{
throw new DbActionExcepti on(ex.ToString( ));
}

// in Service Layer

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

// in UI Layer

try{ //Do somethings }
catch(DbAction Exception 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,
--
Message posted via DotNetMonster.c om
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
4734
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 and is defined in an assembly common to the client and server components. The custom class merely defines three (3) constructors -- the null...
2
8377
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 submitting the form to update the database. The server doesn't have the client side value any more. It seems to me that as I begin to write the...
2
3714
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 all the messages to a message box (ShowMessageBox=true). The required field validation error messages show up in the summary just fine but I can't...
3
3526
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 changed value of that custom attribute is not reflecting back at server side. Any ideas about this problem? Server side code: private void...
8
3880
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 need to avoid the extra round-trip to the client. I've tried Passing the page name, the full URL, and the instance of the handler class to the...
2
330
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 constructors for the serialization to work. The problem is that rigth now I'm forced to have the assembly from the server side present on the client...
4
2166
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 of my functions have try..catch to email me about an error, then I want the application level to fire off to send the user to a custom page AND log...
2
6937
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 attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
2
4591
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: "<type 'exceptions.AssertionError'>:"> Presumably this is because xmlrpclib on the server is catching the exception, and only sending the...
0
7673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7645
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2085
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.