|
This is the problem, I can only get it to throw one when I run it as a Windows Service ... the code works fine using the VS debug trick you linked too ...
And there isn't anything to attach a debugger too since it faults as soon as its started ...
Your right, this is very tricky ...
|
|
|
|
|
Put in your tray\catch, and then in the catch try writing out the exception details to a file or to the debug output stream and then run something like debug-view[^] to watch that stream when you try to start your service.
This allows you to dump out all the details of the exception to read them.
|
|
|
|
|
Hi Again Ray,
Thanks for all your help so far ...
I've wrapped various key area things in try/catch and am outputting exception details to the Debugger (DebugView), no exceptions are getting thrown at all. Nothing get logged in the DebugView window.
I just get a 1053 timeout error ... I can't get ...
I have a method that outputs the endpoint addresses of the service ... I have a load of messages in the Application log telling me that the service is listening on the correct (dynamically generated) endpoints ...
Looks like I have a long session of trying to even get an exception before I can make any progress.
Any other tips would be great chap.
Best,
|
|
|
|
|
Cracked it!!!
hmm ... need to investigate exactly what fixed it however!
Thanks so much for your help, I have more tools in my toolbelt now which is never a bad thing!!
Much appreciated!
|
|
|
|
|
Glad to hear it's working now, even though root cause may be a bit of a mystery.
Don't fro get to close the loop and update the thread with what the problem was so others here can benefit form your frustration
Maybe even a article if the problem was interesting enough
|
|
|
|
|
Hey Chap,
Indeed, I'm thinking of writing this whole thing up. I've made a prototype self-addressing Wcf Windows Service that can be switched between different protocols. And therein lies the mystery!
Basically I had SessionMode=SessionMode.Required set on the main ServiceContract. Then during testing I forgot to remove the http setting from the protocols setting in the config. So then the service starts up with session mode required and then tries to add a basicHttpBinding to the Endpoint Manager ... bang ...
Basically the interaction of config settings need some more management code, if you specify this you can't do this etc ...
The service is headed for a data processing server farm to provide comms so I decided on trying a self addressing thing, that way it could be less setup to do and each machine should be able to find others without the need for a central store of 'registered servers'. If the control center uses the same object, it can self address too then theoretically servers might be able to predict where they will find certain things without being told.
Much work to do before that arrives in full though! Juval Lowy talking about a publisher-subscriber pattern which I'm going to look at later ...
Thank for your help today!
|
|
|
|
|
Hi Friends
I am using silver light and i have taken ScrollViewer.Just i want dynamically change the Items Control(FileUploadControl.xaml) in scrollviewer:-
(scrollviewer x:name="filesScrollViewer" grid.row="3" horizontalscrollbarvisibility="Disabled" verticalscrollbarvisibility="Visible" background="White" xmlns:x="#unknown")
(itemscontrol x:name="fileList">
(itemscontrol.itemtemplate>
(datatemplate>
(app:fileuploadrowcontrol margin="0,2" xmlns:app="#unknown">(/app:fileuploadrowcontrol>
(/datatemplate>
(/itemscontrol.itemtemplate>
(/itemscontrol)
(/scrollviewer>Wink
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Piyush Vardhan Singh wrote: Just i want dynamically change the Items Control(FileUploadControl.xaml) in scrollviewer
What do you want to change?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I need to add styles for the controls in a panel dynamically,
I have created object of the control classes and setted the properties like this
properties.Add(TextBox.FontFamilyProperty, "Arial");
Now I want to add a ControlTemplate similarly, I have created object of ControlTemplate like this
ControlTemplate ctrl = new ControlTemplate();
ctrl.TargetType = typeof(edtPanel);
TextBlock txtbl = new TextBlock();
txtbl.Text = "Test Cotnrol Tempalte";
properties.Add(TextBox.TemplateProperty, ctrl);
edtPanel is the panel name where i need to add all the controls
Now i want to add the txtbl inside the ControlTemplate ctrl, but I don't have any idea how???
Does anybody help me?
Thanks in advance,
|
|
|
|
|
i create a new user control and that is included in my window. and i try to drag an element from the user control and drop it in the window. in the user control i have listview . i drag the listview items from the listview and drop in the window. how i can get the listview control and that particular listview item???
I have to remove the listview item from the listview. any one pls help me......
|
|
|
|
|
It is difficult to answer the question without knowing how you are implementing the Drag and drop ? Taking a guess, removing the object from your object collection would remove it from the listview automatically ?
|
|
|
|
|
This is in user control
<ListView name="pieChart" >
<ListViewItem Style="{StaticResource listviewItemRes}" PreviewMouseLeftButtonDown="ListViewItem_PreviewMouseLeftButtonDown" />
<ListView />
this is in window
<Window x:Class="Music_Diary.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" AllowDrop="True" Drop="Window_Drop" WindowStyle="None" Top="0" Left="0" >
private void ListViewItem_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
DragDrop.DoDragDrop(this.pieChart, sender , DragDropEffects.Copy);
}
private void Window_Drop(object sender, DragEventArgs e)
{
//here what i am going to write to remove the listview item from the listview
}
modified on Thursday, March 26, 2009 3:48 AM
|
|
|
|
|
See this link DragDrop databound[^]
Note the GetBoundItemFromPoint method which might help you.
|
|
|
|
|
I am trying to design our project in MVVM design pattern.
My doubt is where is fix the binding property class in ViewModel
or Model.
ThankYou
|
|
|
|
|
I am not actually sure I understand your question. You can have ViewModel as DataContext of the View. The view defines all the binding with respect to the DataContext. Does that answer your question ?
|
|
|
|
|
Thank you for the Replay
Here the bulk of data fetch from data base, So the Query class in
Model and that Result set class is ViewModel, so that result set is directly
binding to view class .
Or
The Result set class also in Model , that datas are return to the
another one collection class. that collection class is binding to the
View class
Which one is correct
Thank you...
|
|
|
|
|
My thoughts,
I would prefer the second method as the View should be independent of the Model. You have all your processing and business knowledge in the Model. You expose the data to View through the ViewModel. If you directly expose the Model to the View, the View won't be flexible to be used with some other Model in future. The point is, View should not be expected to know of Model, the ViewModel is responsible for everything it needs to know and do.
|
|
|
|
|
Thank you for Replay and explanation.
|
|
|
|
|
Appreciate the reply. It would be very beneficial if you invest some time and read through the excellent MVVM resources on the net. You would get a fair picture of the pros and cons of different approaches being taken and what best suits your need.
|
|
|
|
|
give some Path related to the MVVM design pattern
( if have code more useful to me )
Thank you
|
|
|
|
|
You will get abundant resources on the net. Here are some jems Josh Smith[^], Karl[^] to get you started.
|
|
|
|
|
ABitSmart has given you good advice.
In MVVM, your View never binds to the Model - it always binds to the ViewModel. There are many reasons for this, but the biggest one is that a well designed MVVM application should be testable without the view, so you can "poke" at the ViewModel to exercise it without having to mock up a view.
Similarly, your ViewModel shouldn't access the underlying data - that's the purpose of the model. The ViewModel exists solely to map between a view and a model - it's that simple. So, why do this? Why not map the view to the model? After all, you can test a model in isolation. Well, part of this is because the model exists solely to handle data - it shouldn't provide extensive validation of values, it shouldn't perform business logic, it shouldn't receive invalid values. The ViewModel isolates the model from potentially harmful changes due to user error.
I hope this helps to clarify some of the rationale behind MVVM, and why things are done where they are.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
MVVM really simplifies Testability. I developed a similar architecture named "Part-View-Contract" for the product I was working on two years ago. Acropolis was beta and couldn't depend on its release time frame. It had a Plugin architecure, where Part(as in model),View and Contract(as in ViewModel) dependency were specified as plugin's in a plugin file and the whole UI built up dynamically from the file. The whole idea was to add/remove components by just editing the plugin file. It's been a while now :>
|
|
|
|
|
|
i have an application that was done using silverlight, in which i have used WFC services to establish the comunication with my database (SQL 2008), i have no problem running the application from visual studio 2008 but at the moment of mounting the application in my IIS 7.0 server and try to do any action that requieres communication using the WCF services, it throws me the next error:
User agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618; InfoPath.2)
Fecha: Wed, 25 Mar 2009 18:06:51 UTC
Message: Unhandled Error in Silverlight 2 Application Exception during operation. The result is invalid. Check InnerException for exception details. in System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary ()
in Chat.ServiceReference.isValidCompletedEventArgs.get_Result ()
in Chat.popIniciarSesion.validation_isValidCompleted (Object sender, isValidCompletedEventArgs e)
in Chat.ServiceReference.ServicesClient.OnisValidCompleted (Object state)
Line: 1
Char: 1
Code: 0
URI: http://localhost/Chat.WEB/ChatTestPage.aspx
|
|
|
|