|
|
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
|
|
|
|
|
Any more useful info in the InnerException?
Miraxz wrote: at the moment of mounting the application in my IIS 7.0 server
For the WCF service app:
If you're using web.config to configure the WCF services, make sure your app.config
that works in VS isn't overwriting your web.config if you're using VS to publish the app.
Make sure your svc file(s) are correct.
Are you able to hit your WCF service(s) directly from a URL in a browser?
For the ASP.NET with Silverlight app:
How are you configuring your service client endpoints?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
i have already tried to publish it from VS and also tried to copy the web application folder and neither of them has worked.
I also tried to open the service directly from the explorer and it seems to work fine, it shows the following message : "created a service".
Concerning the EndPoints i have them in basicHTTPBinding if that's what you mean, i have searched and don't see anymore for the innerException.
in fact.. something strange occurs.. i had executed mi application from visual studio at the moment of closing it the temporal asp server that it creates doesn't close, i didn't give it importance at all first but when i tried to run again my application, that i had mounted in my IIS it worked just perfectly. I stopped the temporal asp server and again it stopped working
I see no sense because I never connect to localhost using the port that gave me my temporary server asp...
|
|
|
|
|
Miraxz wrote: when i tried to run again my application, that i had mounted in my IIS it worked just perfectly. I stopped the temporal asp server and again it stopped working
That sounds like the WCF service isn't configured correctly.
Can you post the <system.serviceModel> section of your WCF service web.config
as well as the <system.serviceModel> section of the Silverlight app's
ServiceReferences.ClientConfig file (the published ones, not the ones in the Visual Studio
project)?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi!
in the web.config i have
<system.servicemodel>
<behaviors>
<servicebehaviors>
<behavior name="Chat.Web.ServicesBehavior">
<servicemetadata httpgetenabled="true" />
<servicedebug includeexceptiondetailinfaults="false" />
</behavior>
</servicebehaviors>
</behaviors>
<services>
<service behaviorconfiguration="Chat.Web.ServicesBehavior" name="Chat.Web.Services">
<endpoint address="" binding="basicHttpBinding" contract="Chat.Web.IServices">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.servicemodel>
in ServiceReferences.ClientConfig
<system.servicemodel>
<bindings>
<basichttpbinding>
<binding name="BasicHttpBinding_IServices" maxbuffersize="2147483647">
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basichttpbinding>
</bindings>
<client>
<endpoint address="http://localhost:49245/Services.svc" binding="basicHttpBinding">
bindingConfiguration="BasicHttpBinding_IServices" contract="ServiceReference.IServices"
name="BasicHttpBinding_IServices" />
</endpoint></client>
</system.servicemodel>
ServiceReferences.ClientConfig not found it in my application mounted at the IIS, I guess is in the .XAP of my IIS ... or... I am wrong?
thk again...
|
|
|
|
|
Miraxz wrote: I guess is in the .XAP of my IIS
I think you already found it, but just in case...
Yes, it should be
The xap is a zip file so you can extract/edit/etc. files in the xap just
like any other zip file.
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thk Mark!!!
the ServiceReference.ClientConfig was configured in precisely the wrong endpoint...
<client>
<endpoint address="http://localhost:49245/Services.svc" binding="basicHttpBinding">
bindingConfiguration="BasicHttpBinding_IServices" contract="ServiceReference.IServices"
name="BasicHttpBinding_IServices" />
</endpoint></client>
Change that line "http://localhost:49245/Services.svc"
for "http://localhost/Chat/Services.svc"
really thk!!! !!! !!! !!!
|
|
|
|
|
Cool!
Miraxz wrote: http://localhost/Chat/Services.svc
Don't forget that will only work for clients on the same machine the service is
running on
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I tried it the traditional C# way of:
public String test
{
get
{
return "hi";
}
set
{
button1.Content = value;
}
}
But the WPF designer didn't seem to be able to detect it, although I could still do it programatically.
What's the proper way of declaring a new property for a control?
Thanks.
|
|
|
|
|
That Asian Guy wrote: WPF designer didn't seem to be able to detect it
It does show up in XAML. What exactly are you referring to ?
That Asian Guy wrote: What's the proper way of declaring a new property for a control?
If you want it to take part in binding(as a target specifically),styles,animations etc. you might want to implement it as a DependencyProperty[^]
|
|
|
|
|
Hi all!
I'm newbie in WPF, so sorry about stupid question.
It is possible to show combobox side by side with selected TreeViewItem?
I need something like shown in the left picture at the following link: http://www.mypicx.com/03242009/Combobox_in_TreeviewItem/
I tried to do thus:
<TreeView Name="treeView1">
<TreeViewItem Header="aaa">
<ComboBox Height="19">
<ComboBoxItem Content="111" IsSelected="True"></ComboBoxItem>
<ComboBoxItem>222</ComboBoxItem>
<ComboBoxItem Content="333"></ComboBoxItem>
</ComboBox>
<TreeViewItem Header="aaa1">
</TreeViewItem>
<TreeViewItem Header="aaa2">
</TreeViewItem>
</TreeViewItem>
<TreeViewItem Header="bbb">
<TreeViewItem Header="bbb1" />
<TreeViewItem Header="bbb2" />
</TreeViewItem>
<TreeViewItem Header="ccc" />
</TreeView>
and the result you can see in the right picture.
Meantime I need to know, how to do this visually. Later I need to do something with SelectedItemChanged event.
Thanks in advance!
P.S. sorry about my english
|
|
|
|
|
Put the combobox in the header aswell.
<TreeView Name="treeView1">
<TreeViewItem>
<TreeViewItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock>aaa</TextBlock>
<ComboBox Height="19">
<ComboBoxItem Content="111" IsSelected="True"></ComboBoxItem>
<ComboBoxItem>222</ComboBoxItem>
<ComboBoxItem Content="333"></ComboBoxItem>
</ComboBox>
</StackPanel>
</TreeViewItem.Header>
<TreeViewItem Header="aaa1">
</TreeViewItem>
<TreeViewItem Header="aaa2">
</TreeViewItem>
</TreeViewItem>
<TreeViewItem Header="bbb">
<TreeViewItem Header="bbb1" />
<TreeViewItem Header="bbb2" />
</TreeViewItem>
<TreeViewItem Header="ccc" />
</TreeView>
|
|
|
|
|
Great!
Thank you very much.
|
|
|
|
|
I am experiencing some problems using the trackball.cs class from 3D Tools.
I bind the class to an object surrounding my 3D viewport (because if you bind on the viewport the clickable area is only on the object if i'm not mistaken) and my object turns to face wherever I click. The camera DOES rotate when I drag the mouse, but on the mousedown event the camera resets to wherever i'm clicking which is very annoying.
Here is a link to my app which will help you understand the problem. (checked with virus total)
http://www.yourfilehost.com/media.php?cat=other&file=3121Jubei_WPF_App_3D.zip
Any insight on the issue would be appreciated!
Jubei
|
|
|
|
|
Hi
i received a request to create a Music Player with specific features ,sincerely i did not develop a Music Player in past time(just 7 months i began to develop programs ).
I try to explain correctly these features requested right now.
This Music Player will Play music in modality "Random" (first request) downloading songs from a folder and one more request is to change "Genre" of music each 4 hours for example:
- from 8am to 12am : plays "Romantic" songs;
- from 12am to 4pm : plays "Latin" songs;
- from 4pm to 8pm : plays "Rock" songs;
- from 8pm to midnight : plays "Dance" music;
My purpose is to create different song's folder for each Genre and give respective TitleName(Romantic,Latin,Rock,etc..etc..) and when start the music player will automatic download the song's folder following the time slot...i hope to be clear.
So i ask you some advice about the code how organize these features because i don't know how change the Genre Music for hours and put the music player in modality Random .
I hope don't give you bother.
Thanks in advantage.
Nice Regards
|
|
|
|
|
For the music player check the MediaElement. To make it play randomly and select songs from a folder, I would put the songs in a collection; get the length of the collection, and randomly select a song.
I use this logic to make the music player in my software work. It picks songs randomly.
|
|
|
|
|
Hi the treeview of asp.net webapplication, with a drag and drop functionality its working .But while running the application but when it done the refreshing its took its original position.Please suggest me what to do for while changing the elements in the child node remain same after refreshing???
Thanks and Regards
Ch.Gayatri Subudhi
|
|
|
|
|
Ch.Gayatri Subudhi wrote: the treeview of asp.net webapplication
If this isn't a Silverlight TreeView, then you may get better results
asking on the ASP.NET board[^].
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
How do I go about editing items in a bound ListBox? I thought it would be as simple as binding a TextBox to the ListBox, but apparently, it's not.
I am creating a WPF window that displays a list of color names in a ListBox. The list comes from a property on the DataContext, to which the ListBox.ItemsSource property is bound. When I select a ListBox item, I want it to appear in a TextBox. Any changes I make in the TextBox should update the selected ListBox item.
Here's my XAML for the ListBox:
<ListBox
x:Name="ListBoxColors"
ItemsSource="{Binding ColorNames}" />
And here's my XAML for the TextBox, whose Text property is bound to the ListBox:
<TextBox
Text="{Binding ElementName=ListBoxColors,
Path=SelectedValue.Content, Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}" />
The ListBox binding works fine in both directions, but the TextBox binding only works in one direction--from the ListBox to the TextBox. Canges in the TextBox are not propagated back to the ListBox.
Here's my question: Can a TextBox Be bound to a bound ListBox in XAML, or do I have to go back to handling events in code-behind. If it can be done with XAML bindings, how? Thanks for your help.
David Veeneman
www.veeneman.com
|
|
|
|
|
It worked fine. When I select something in the ListBox the TextBox shows that value. When I type something in the Textbox the corresponding item does get selected (i.e. if the value in TextBox exists in the ListBox else nothing is selected). Mine is a simple example though, just a list of strings.
My code (used the same example that I built for Christian in the above post )
XAML,
<TextBox Text="{Binding ElementName=playlists, Path=SelectedValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<ListBox Name="playlists" ItemsSource="{Binding Path=Files}" SelectionMode="Single"/>
Code behind,
public class Playist
{
public ObservableCollection<string> Files { get; set; }
public Playist()
{
Files = new ObservableCollection<string>();
Files.Add("a");
Files.Add("b");
Files.Add("c");
Files.Add("d");
}
}</string></string>
private Playist _playlist = new Playist();
public Window1()
{
InitializeComponent();
playlists.DataContext = _playlist;
}
|
|
|
|
|
Thanks, but I pasted your code and markup into a WPF project, and I still have the same problem. I have pasted my complete code and markup below.
What I want to do is implement two-way binding between the listbox and the textbox; i.e., click on a listbox item and have it appear in the textbox. Then, edit the item in the textbox and have the changes propogated back to the list box. If the listbox ItemsSource property is bound to a DataContext, two-way databinding between the listbox and the textbox doesn't work--it's only one way, from the listbox to the textbox.
To see what I mean, remove the ItemsSource binding from the listbox, then add the four PlayList strings to the listbox using the Designer's Items property. Change the textbox binding path to SelectedValue.Content, and run. You will have two-way binding between the textbox and the listbox. Edit the textbox, and the changes appear in the listbox.
Now, restore the original code. The textbox-listbox binding is now only one-way--from the listbox to the textbox. Changes in the textbox are not propagated back to the listbox.
That brings me back to my original question: Is there any way to implement two-way binding between the textbox and the listbox, while maintaining the listbox ItemsSource binding to the PlayList object?
My markup:
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<StackPanel>
<TextBox Text="{Binding ElementName=playlists, Path=SelectedValue.Content, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<ListBox Name="playlists" SelectionMode="Single">
<ListBoxItem>a</ListBoxItem>
<ListBoxItem>b</ListBoxItem>
<ListBoxItem>c</ListBoxItem>
<ListBoxItem>d</ListBoxItem>
</ListBox>
<!-- ItemsSource="{Binding Path=Files}" -->
</StackPanel>
</Window>
My code:
using System.Windows;
using System.Collections.ObjectModel;
namespace WpfApplication1
{
public partial class Window1 : Window
{
private PlayList _playlist = new PlayList();
public Window1()
{
InitializeComponent();
playlists.DataContext = _playlist;
}
}
public class PlayList
{
public ObservableCollection<string> Files { get; set; }
public PlayList()
{
Files = new ObservableCollection<string>();
Files.Add("a");
Files.Add("b");
Files.Add("c");
Files.Add("d");
}
}
}
David Veeneman
www.veeneman.com
|
|
|
|
|
My apologies, I misintepreted your question. Updated the code snippet, hopefully I have got you correct this time.
XAML,
<TextBox Text="{Binding ElementName=playlists, Path=SelectedItem.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<ListBox Name="playlists" ItemsSource="{Binding Path=Files}" SelectionMode="Single">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Code,
public class MyFile
{
public string Name { get; set; }
}
public class Playist
{
public ObservableCollection<myfile> Files { get; set; }
public Playist()
{
Files = new ObservableCollection<myfile>();
Files.Add(new MyFile { Name = "a" });
Files.Add(new MyFile { Name = "b" });
Files.Add(new MyFile { Name = "c" });
Files.Add(new MyFile { Name = "d" });
}
}
public partial class Window1 : Window
{
private PlayList _playlist = new PlayList();
public Window1()
{
InitializeComponent();
playlists.DataContext = _playlist;
}
}</myfile></myfile>
Is this what you are trying to sort out ?
|
|
|
|
|
Post deleted because it's wrong. ABitSmart came up with the solution.
David Veeneman
Foresight Systems
David Veeneman
www.veeneman.com
modified on Wednesday, March 25, 2009 11:22 AM
|
|
|
|
|
I was writing my reply while you posted this. Well, yes, you can use one of the two, not both at a time. In your case, using ItemsSource renders Items readonly. But you can modify ItemsSource. The example I posted does that.
|
|
|
|