|
<pre><applicationSettings>
<add name="Your key"/>
</applicationSettings></pre>
|
|
|
|
|
Why do you NEED To do it in XML ? Does it give you real advantages, or does it just sound cool ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
why not in the registry too ?
most programs use it to store the windows size, position and so on there...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I wouldn't touch registry unless I really had to. It is an option, but IMHO it's not nice. For many reasons, e.g. additional platform dependency, breaks XCopy deployment...
David
David
|
|
|
|
|
I have an example where I have a client and a server. Via remoting I am instantiating a remote object (singleton mode), calling a method on the remote object, which fires an event (using a delegate) back to the client machine. I have created a tcp channel on both the client and the server for bi-directional communication.
If I start the server, then start the client, everything works fine and calls to the server result in an event being fired and sent back to the client.
If I keep the server running, shutdown the client, restart the client listening on the same port, I get the following error:
System.Runtime.Remoting.RemotingException: Requested Service Not Found
I have a feeling this has to do with the remote object lease, but I'm not sure what I need to do in this case.
If anybody could help me, I'd greatly appreciate it.
|
|
|
|
|
I suspect it's got something to do with lease too. Server objects get disconnected from the remoting framework after a particular period of inactivity (no method calls on the server).
I'd suggest overriding InitializeLifetimeServices and returning null. That would keep the server object connected forever.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I have already attempted this and it does not fix the problem. It seems that the keeping the server alive keeps a reference to the client port. Closing the client and then re-opening will re-open that port, but somehow the server cannot communicate via the port.
If I unregister the server channel and then recreate it, it works fine.
|
|
|
|
|
I have resolved this issue. I was attaching event handlers from the client proxy to a remote event, but was not removing the handler when the client shut down. Therefore, the server was still attempting to trigger the remote events to the client, which was no longer alive.
|
|
|
|
|
I see. I guess you're removing the event handlers when the client closes. But what will you do if there are 5 clients for your singleton object and the first subscriber's event handler throws an exception?
I'd suggest manually invoking the event within a try catch block. Something like
protected void OnEventOccurred(...)
{
if (eventHandler == null)
return;
Delegate []delegateList = eventHandler.GetInvocationList();
foreach(MessageReceivedEventHandler handler in delegateList)
{
try
{
handler(this, args);
}
catch(Exception e)
{
}
}
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
In my prototype, the event is added during a call to the remote, async process. I am removing the event handler once the event is received on the client proxy and the process has successfully completed. I then raise a local event to a user defined event handler, where they can monitor the status of the remote process, cancel it, etc...
I will also wrap all of the appropriate code in try catch blocks to trap, log and allow successfull recovery of my code.
I appreciate your comments and help!
Mark
|
|
|
|
|
Hi!
I was wondering if it's possible to validate the input given in setup dialogs in a setup project created in VS.NET?
In my setup I've added a Textboxes(A) dialog for the user to input a port to be written into a config file.
I haven't found a way to verify that the input is correct (or that the user even entered _anything_) before feeding it into my custom action.
Is there a way to achieve this?
Thanks in advance for every input,
mav
|
|
|
|
|
There are plenty of articles and samples out there that teach us how to add to Outlook. What about reading data from? I have found a few articles about getting email information and have implemented those into some of my projects. Now I'm faced with reading the calendar information. I have searched hi and low for articles, samples and even discussions by yet to find anything worth while.
I'm sure with the new Interop components there is a way to read a users calendar information do you know or have you come across an article worth reading?? Samples??
|
|
|
|
|
Hi,
Is it possible to measure execution time of methods
of my classes without adding any code to them.
Say I have a class library (without source code) and I
would like to know how long some of it's methods work.
Does .NET runtime allow to obtain list of methods it executed
from some assembly and their execution time ?
Using Reflection namespace I could filter methods I need.
Please, give a hint on it.
Thanks,
Slava
|
|
|
|
|
You can buy third party tools that do this, but they will inject some timing code, just as you might. The way to test a class library is to get the current time in your code, call the method, get the time again, and see how much time elapsed.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
LOL - I guess it was lacking in the 'do no work and see the result' factor required.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I tought if .NET controls execution it
can measure time of methods it executes.
|
|
|
|
|
You can pinvoke and call QueryPerformanceCounter . Call it before and after calling the method and the difference is the time it took to execute.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Have a look at NProf. Its probably what you are searching for.
|
|
|
|
|
Found your message after discovering this API myself,
thanks anyway.
|
|
|
|
|
It appears there is a Profiling API which does what I need.
|
|
|
|
|
hi all
i am working in application using visual stdio.net by c# and i need to use
codes from mathLab in my application
my qustion is : how can i binding or "use" mathLab to visual studio.net??
|
|
|
|
|
What is mathLab ? Not Matlab ?
It depends - does this library expose a COM interface ? If not, then probably not ( I assume it's not written in C# ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
How does .NET framework help with accessing Legacy systems? I have worked in this area on Java, using the various connectors. For .NET the suggestion seems to be to use web services, but I have not been able to go beyond this point.
If I developing an n-tier application, where I need to use an RDBMS and Legacy system, I am not sure to how to make the connection and maintain the integrity of data.
If someone can point me to some useful link or a direct sample, it would be of immense help.
Regards,
Rajiv
|
|
|
|
|
Hi,
I am new to this forum .. anyway currently I am doing some research work in context aware mobile phone application and one of the main area require me to access the phone functionality such as the ringer volume, vibration on or off, power on or off and I need to be able to change them based on different scenario .... I am just wondering if anyone know that any module in .net compact framework would allow me to do this ... and have this been done before ? any link to existing article will be great.
Cheers
rd7
|
|
|
|