|
Thanks for your help Gideon That's exactly what I needed. I always tried to apply the trigger to the border or to the textbox itself :-/
Regards,
Jammni+
|
|
|
|
|
Hi,
I am just starting to learn WCF. In all the examples I've seen so far, the SerciveHost was initialized inside a console application and remained listening until the console was closed.
I am trying to have it initiated from inside a winform app. I have a button which triggers this method:
private void StartServer()
{
using (host = new ServiceHost(typeof(DataBase.DataBaseService ), new Uri("http://localhost:8000/DataBaseService")))
{
host.AddServiceEndpoint(typeof( DataBase.IDataBaseService),
new BasicHttpBinding(), "DataBaseService");
host.Open();
}
}
As soon as the method reaches the end, host.Status is set to Closed.
Is there any way to stop this?
|
|
|
|
|
The problem you're facing here is that you are disposing of the host immediately after opening it. What you might want to do here is to make host a member instead, then initialise it in StartServer. In your Form_Closing method, you would want to close host.
private _host = null;
private void StartServer()
{
_host = new ServiceHost(typeof(DataBase.DataBaseService ), new Uri("http://localhost:8000/DataBaseService"));
_host.AddServiceEndpoint(typeof(DataBase.IDataBaseService),
new BasicHttpBinding(), "DataBaseService");
_host.Open();
}
private void StopServer()
{
if (_host != null)
{
_host.Close();
_host.Dispose();
}
} Call StopServer in the Form_Closing event.
|
|
|
|
|
I did have host as a member. I think the problem was using the 'using' statement. After looking at your code I dropped it and it works so thanks a lot.
|
|
|
|
|
Not a problem. For your information - the using statement here triggers a Dispose when the code reaches the end of the code block (which was the point I was trying to make).
|
|
|
|
|
|
What do you mean by this? I really don't understand your question, so could you please clarify what you are after.
|
|
|
|
|
What do you feel are the 3 biggest advantages of WPF over ASP.NET?
What do you feel are the 3 biggest advantages of WPF over Winforms?
It seems like WPF may be more time-consuming to develop in with fewer 3rd party controls.
|
|
|
|
|
Member 3919049 wrote: It seems like WPF may be more time-consuming to develop in with fewer 3rd party controls.
Hell no. I can knock applications up in WPF either as quickly, or quicker than in ASP.NET. Try this[^] article (shameless plug ). Try this[^] article by Karl about why his company chose WPF over ASP.NET.
|
|
|
|
|
Nice articles by both you and Karl
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hello, I would appreciate if someone could give a hint on what is happening.
Is this a Microsoft BUG ???
I have WinForms application that uses starts Workflows.
App.Config contains WorkflowRuntime configuration.
From VisualStudio 2008, when I click F5 (Start Debugging) everything works fine.
When I click Ctrl-F5 (Start Without Debugging), the EXE is compiled, but EXECUTION FAILS
When I enter the debug mode, it shows that it fails here:
WorkflowRuntime workflowRuntime = new WorkflowRuntime("WorkflowRuntime");
An error occurred creating the configuration section handler for WorkflowRuntime: Invalid syntax. (D:\Visual Studio 2008\Projects\CCO.WEBSTER\CCO.WEBSTER.WinClient\bin\Debug\CCO.WEBSTER.WinClient.exe.Config line 4)
The application WORKS FINE IN DEBUG mode, .Config File is correct!
Generated WinClient.exe.Config is exactly the same as App.Config.
The exception is thrown when the app is started without debugging,
it means that EXE is compiled just fine, but EXECUTION FAILS.
Please HELP, I wasted a month of hard work on this!
|
|
|
|
|
So, what is on line 4 of your config file?
|
|
|
|
|
Configuration settings for WorkflowRuntime.
I can't post it here, doesn't display properly XML code.
It absolutely doesn't matter!
It works when I click F5 (Start With Debugging).
I also found out, that app works fine when compiled in Release mode.
So something happens when it's compiled in Debug mode.
But When started with Debugging (CTRL-F5) it also works.
This is totally weird
|
|
|
|
|
|
|
Amazing ... frankly its all a bit beyond me at the moment.
Utmost respect to Josh.
|
|
|
|
|
BTW - Watch Karl's XAML Power Toys video on Channel9. It's tres cool.
|
|
|
|
|
Will do!
PS - Vista compatible SS due to drop this w/e ...
|
|
|
|
|
Cool. Tell you what, I'll send you with the WpfFolderBrowser as it stands right now, so you can have a look. It's a long way from complete, but it should give you a pretty good idea about where I'm going with it. Also, it would be nice to have somebody else eyeballing it.
|
|
|
|
|
|
I agree. Both Josh and Karl are really good at this WPF/XAML stuff
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
They're none too shoddy. If you want to see how it all hangs together, you may want to follow this[^] blog entry.
|
|
|
|
|
Pete O'Hanlon wrote: you may want to follow this[^] blog entry
Added to my ever growing list of bookmarks [grins].
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Booknot is. Read you do. Hmmm?
|
|
|
|
|
Read frequently I will
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|