R
Rich
There's no Silverlight Managed Newsgroup yet - MSDN concierge says to post my
question here. Please re-route, if nec.
I am writing a VERY simple Silvelight app. It's for a
presentation/demonstration and therefore NEEDS to be simple.
App needs to download XML info from server to Silverlight client.
This works in XP...
Sub OnLoad(ByVal Sender As Object, ByVal e As RoutedEventArgs) _
Handles Me.Loaded
Dim _webClient As New WebClient()
AddHandler _webClient.OpenReadCompleted, AddressOf XMLLoaded
_webClient.OpenReadAsync(New Uri("Movies1Xml.Xml", UriKind.Relative))
End Sub
Protected Sub XMLLoaded(ByVal Sender As Object, ByVal e As
OpenReadCompletedEventArgs)
If e.Error Is Nothing Then
Dim rss As XElement = XElement.Load(e.Result)
Dim movieArray As XElement = rss.Element("Movies")
Dim movieElements As IEnumerable(Of XElement) = movieArray.Elements("Movie")
...
End If
End Sub
Does not work in Vista (even when I run Visual Studio "as administrator").
"Movies1.Xml.Xml" is in ClientBin, where the .xap is. In Vista, when I use
UriKind.Relative, Exception is "NotSupported" and InnerException says "Uri
Prefix not defined". If I use a full path to the file with UriKind.Absolute
- I get a SecurityException.
I even tried a clientaccesspolicy.xml file on the server - no luck. What do
I need to do to make this work in Vista?
question here. Please re-route, if nec.
I am writing a VERY simple Silvelight app. It's for a
presentation/demonstration and therefore NEEDS to be simple.
App needs to download XML info from server to Silverlight client.
This works in XP...
Sub OnLoad(ByVal Sender As Object, ByVal e As RoutedEventArgs) _
Handles Me.Loaded
Dim _webClient As New WebClient()
AddHandler _webClient.OpenReadCompleted, AddressOf XMLLoaded
_webClient.OpenReadAsync(New Uri("Movies1Xml.Xml", UriKind.Relative))
End Sub
Protected Sub XMLLoaded(ByVal Sender As Object, ByVal e As
OpenReadCompletedEventArgs)
If e.Error Is Nothing Then
Dim rss As XElement = XElement.Load(e.Result)
Dim movieArray As XElement = rss.Element("Movies")
Dim movieElements As IEnumerable(Of XElement) = movieArray.Elements("Movie")
...
End If
End Sub
Does not work in Vista (even when I run Visual Studio "as administrator").
"Movies1.Xml.Xml" is in ClientBin, where the .xap is. In Vista, when I use
UriKind.Relative, Exception is "NotSupported" and InnerException says "Uri
Prefix not defined". If I use a full path to the file with UriKind.Absolute
- I get a SecurityException.
I even tried a clientaccesspolicy.xml file on the server - no luck. What do
I need to do to make this work in Vista?