|
That is true,
but suppose that changing the envirnment is out of the question. How would you come around such a problem?
|
|
|
|
|
Dear All
I created a project with full exception handling (Try, Catch) in all subs and functions, I know that this will affect the performance negatively but i'm in the testing phase and exception handling will be removed for the release
My question is: is there a way to keep the exception handling statements and restrict them to the debug mode and step over them in realease mode without having to keep two seperate copies for debug and release?
I was told that this was available in Visual Studio 6 so there must be something like it in VS 2003
Thanx in advance for help
Best Regards
3ala2
|
|
|
|
|
#if DEBUG
but it's not recommended.
|
|
|
|
|
ednrgc wrote: but it's not recommended.
And why is that?
only two letters away from being an asset
|
|
|
|
|
Because the try/catch/finally blocks should be used throughout, not just in debug mode. The performance hit is not as great as some people expect. Even if it's inside a multi-iteration loop, you may be able to move the try block outside the loop.
|
|
|
|
|
Your post seemed to imply #if DEBUG was not recommended
only two letters away from being an asset
|
|
|
|
|
Oops Sorry for my lack of articulation. Point well taken.
|
|
|
|
|
It's a really bad idea to have try/catch functionality in your debug build and not in your release build. The code execution in the release will not be the same as the debug version. If you catch an error in the debug version, the release version should be able to cope with it as well.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I'll second Pete, exception handling is not just for debug.
If you make use of the Exception Handling in the Enterprise Library you can use the config file to adjust how the exceptions may be handled in either release or debug, without recompiling the app.
only two letters away from being an asset
|
|
|
|
|
I should add that the performance of try/catch/finally is not as bad as people seem to think. The overhead really occurs when an error happens.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Still no1 answered
I was asking for setting
I guess that means that this is not avaialbel in .net 2003
Thanx Every1
Best Regards
3ala2
|
|
|
|
|
just3ala2 wrote: Still no1 answered
Errm. No, lots of people answered. They just didn't give you the answer that you wanted.
What you were talking about was the TRY/CATCH macros in Visual C++. These were compiled out of release builds because they effectively mapped in as:
#ifdef DEBUG
try
{
#endif
and so on. Now, as has been stated earlier, it is a bad idea to have debug code that does one thing and release code that does another. If you have an exception, you need to catch it and deal with it.
What you did wrong was to design your application to have try/catch in every method. This is normally bad design. Consider the following sample:
public void SetMyValue(string value)
{
try
{
_myValue = value;
}
catch (Exception ex)
{
}
}
What exception are you going to get here?
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
How i can send class between to website like client and server ?
|
|
|
|
|
Is there any way to call a web service without making a web reference in your project or generating proxy classes using wsdl.exe? The project I am working on involves calling a number of web services listed in the appsettings section of the web.config. The app will eventually test these web services for responsiveness. One of the requirements is that it should be configurable from the web.config and should not have to be recompiled upon adding a new web service. I googled a few hours yesterday with little results. Any ideas?
Thanks,
Scott Stocker
|
|
|
|
|
|
I know what WSDL is. I am looking for a .NET way to load a web service without a web reference in my project. I know that a WSDL definition will probably be key in accomplishing a dynamic call to a web service but I was unable to find code to accomplish the dynamic call I am looking for.
|
|
|
|
|
sstocker wrote: I am looking for a .NET way to load a web service without a web reference in my project.
Well since WSDL provides that capability perhaps you don't know what it is? To use a new web service your configuration information would supply the URL to the WSDL for the new service. Your code would then use the response WSDL to know how to format and where to send a request to the service. Of course the WSDL does not tell where to get the input parameters in your system or even what to do with the response data that might be returned from the web service so I don't really understand the point of all this, but there it is anyway.
led mike
|
|
|
|
|
Hi All,
I have a case that i need to browse through the directories and files of a unix server through C#.NET or VB.NET Code. Can anyone help me out???
Exact scenario of the problem is:
i need to ftp a file to unix server from windows machine through VB.NET Code. But Before that i need the check the unix server whether the file already exist or not in a particular directory of the unix server. If the file already exist in the unix server, i have to wait until the file to be removed in the unix server and then ftp the file to unix server.
gokulnath
|
|
|
|
|
Dear all,
I had crystal project which exports on demand subreport data to any format in vs.net 2003. It is working fine for both main report and sub report.
Now i am converting to vs.net 2005, it gives error. for the code :
CRD = crSubreportObject.OpenSubreport crSubreportObject.SubreportName)
Exp_stream = CType(CRD.ExportToStream(ExportFormatType.Excel), MemoryStream)
This code gives "Not Supported within subreports"
Pls help to export on demand subreport. Then only i will move to vs.net 2005.
by
Suresh Kumar
|
|
|
|
|
Hi,
I uploaded site in one folder of the ftp location. When i open url, it is giving me following error.
Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
=================
I tried to change all 3 modes of customErrors but same problem.
Can anyone help me please?
Thanks.
|
|
|
|
|
Make sure it is case sensitive
Ghazi Hadi Al Wadi, PMP, ASQ SSGB, DBA
|
|
|
|
|
Is this running on IIS? If so, it may be an application name setting.
|
|
|
|
|
Yes it is running under IIS. I will not be able to change setting of IIS as it is remote server somewhere.
|
|
|
|
|
you have to find out if the "application" setting was set, or it may never work.
|
|
|
|
|
i have one .swf object how i have to call that flash to asp.net page
|
|
|
|