NotSupportedException using RemoteProviderSettingsUri

Apr 22, 2012 at 11:15 AM

Hi Mark, 

This is awesome! However, I am having a problem. When I point my RemoteAdProviderStrategy at my XML file on my site, I get a NotSupportedException during MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.ParseXml(String xml). The app crashes. I was surprised it didn't simply fall back to the Local file as expected. If I don't specify the RemoteProviderSettingsUri, it works fine. I'd be happy to provide the stack trace and/or URI to the file if you're interested. 

I can access the xml in a browser so I don't think it's accessibility but I'm sure I'm doing something wrong.

Thanks for this btw. It really is great and I hope to figure out how to leverage the remote strategy before my next shipping. 
-Jonathan 

Coordinator
Apr 22, 2012 at 11:52 AM

Hi Jonathan,

It is indeed suprising that it didn't fallback. But the fallback mechanisme is during the gathering of xml. It could very well be that there's a small problem in the XML. If you could either share the url and/or the xml that would be great.

 

Best,

 

Mark Monster

Apr 22, 2012 at 2:30 PM

Mark,

Here is the URL I am using:

http://mobile.digitalmason.net/jackoftoolspro/AdSettings.xml

Here is the context:

<Ads:AdControl.AdProviderStrategy>           
<Strategy:RemoteAdProviderStrategy xmlns:Strategy="clr-namespace:MC.Phone.Ads.Strategy;assembly=MC.Phone.Ads"
LocalProviderSettingsUri="Ads/AdSettings.xml"
RemoteProviderSettingsUri="http://mobile.digitalmason.net/jackoftoolspro/AdSettings.xml" />
</Ads:AdControl.AdProviderStrategy>

When I remove the RemoteProviderSettingsUri, things work as expected using the XML in the XAP.

Thanks
-Jonathan

Coordinator
Apr 22, 2012 at 6:43 PM

Hi Jonathan,

 

I'm not completely sure, but my guess is that you're using Google Sites, or something similar. The direct response of that url is html instead of xml

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<title xmlns="http://www.google.com/ns/jotspot">Download Attachment</title>
<link rel="stylesheet" type="text/css" href="/_/rsrc/1334094726000/system/app/css/camelot/dashboard.css" />
<link rel="stylesheet" type="text/css" href="/_/rsrc/1334094726000/system/app/css/camelot/error.css" />
<style xmlns="http://www.google.com/ns/jotspot">
              #sites-dash-sandbar,
              .sites-dash-appbar {
                top: 0px;
              }
              .goog-ws-dash-main {
                margin-top: 0;
              }
            </style>
</head>
<body xmlns="http://www.google.com/ns/jotspot">
<div xmlns="http://www.w3.org/1999/xhtml" class="sites-dash-appbar"><div class="sites-dash-appbar-content"><div class="sites-dash-appbar-left goog-inline-block">Sites</div><div class="sites-dash-appbar-center goog-inline-block"><div class="sites-global-pages-header-text">Download Attachment</div></div><div class="sites-dash-appbar-right goog-inline-block"></div></div></div>
<div xmlns="http://www.w3.org/1999/xhtml" id="sites-status" class="sites-status" style="display:none;"><div id="sites-notice" class="sites-notice" role="status" aria-live="assertive"> </div></div>
<div class="sites-content-wrapper goog-ws-dash-main">
<p xmlns="http://www.w3.org/1999/xhtml">
<div class="sites-global-pages-content-wrapper"><div class="sites-global-pages-content"><div class="sites-global-pages-content-section">Click <a href="/jackoftoolspro/AdSettings.xml?attredirects=0">here</a> to download your attachment.</div></div></div>
</p>
</div>
</body>
</html>

From there in the browser there are a couple of redirects which in the end results in a url like: https://721799946776365234-a-digitalmason-net-s-sites.googlegroups.com/a/digitalmason.net/mobile/jackoftoolspro/AdSettings.xml?attachauth=*REMOVEDTHEVALUEFORSECURITYPURPOSE*&attredirects=0

I removed a small part of it. Maybe this is not the best place to host the file. I did a prove of concept with Dropbox which does work.

Hope this helps.

Best,

 

Mark Monster

Apr 22, 2012 at 8:32 PM
Mark,

Yes, you're right. It is Google sites. Now that you point it out, I noticed something weird with that one time but I guess the browser normally hides that and downloads the content. Sorry to waste your time on that and thank you for figuring it out.

I will find somewhere else to put the file or try dropbox.

Again, this is a really awesome library. I can't thank you enough.
-Jonathan

On Sun, Apr 22, 2012 at 11:43 AM, mkamonster <notifications@codeplex.com> wrote:

From: mkamonster

Hi Jonathan,

I'm not completely sure, but my guess is that you're using Google Sites, or something similar. The direct response of that url is html instead of xml

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<title xmlns="http://www.google.com/ns/jotspot">Download Attachment</title>
<link rel="stylesheet" type="text/css" href="/_/rsrc/1334094726000/system/app/css/camelot/dashboard.css" />
<link rel="stylesheet" type="text/css" href="/_/rsrc/1334094726000/system/app/css/camelot/error.css" />
<style xmlns="http://www.google.com/ns/jotspot">
              #sites-dash-sandbar,
              .sites-dash-appbar {
                top: 0px;
              }
              .goog-ws-dash-main {
                margin-top: 0;
              }
            </style>
</head>
<body xmlns="http://www.google.com/ns/jotspot">
<div xmlns="http://www.w3.org/1999/xhtml" class="sites-dash-appbar"><div class="sites-dash-appbar-content"><div class="sites-dash-appbar-left goog-inline-block">Sites</div><div class="sites-dash-appbar-center goog-inline-block"><div class="sites-global-pages-header-text">Download Attachment</div></div><div class="sites-dash-appbar-right goog-inline-block"></div></div></div>
<div xmlns="http://www.w3.org/1999/xhtml" id="sites-status" class="sites-status" style="display:none;"><div id="sites-notice" class="sites-notice" role="status" aria-live="assertive"> </div></div>
<div class="sites-content-wrapper goog-ws-dash-main">
<p xmlns="http://www.w3.org/1999/xhtml">
<div class="sites-global-pages-content-wrapper"><div class="sites-global-pages-content"><div class="sites-global-pages-content-section">Click <a href="/jackoftoolspro/AdSettings.xml?attredirects=0">here</a> to download your attachment.</div></div></div>
</p>
</div>
</body>
</html>

From there in the browser there are a couple of redirects which in the end results in a url like: https://721799946776365234-a-digitalmason-net-s-sites.googlegroups.com/a/digitalmason.net/mobile/jackoftoolspro/AdSettings.xml?attachauth=*REMOVEDTHEVALUEFORSECURITYPURPOSE*&attredirects=0

I removed a small part of it. Maybe this is not the best place to host the file. I did a prove of concept with Dropbox which does work.

Hope this helps.

Best,

Mark Monster

Read the full discussion online.

To add a post to this discussion, reply to this email (wpunifiedad@discussions.codeplex.com)

To start a new discussion for this project, email wpunifiedad@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com




--
Sent from my fully operational battlestation.

www.digitalmason.net

Join the digitalmason.net Beta program and be among the first to try and provide feedback for Windows Phone 7 and Windows 8 apps.

Find out what's next or happening right now by following us on Twitter

Apr 24, 2012 at 6:09 AM

On a related note (I think) I am getting the same error (stack trace below) hosting the remote AdSettings.xml on Dropbox.  I thought at first that I had the Xml wrong, as I had used a version of the Xml with a load of namespaces in it, but after changing that to the plainer version I am still getting a load of errors being returned.

I am wondering if Dropbox is returning an error as an Html page in some instances, the app is not that heavily used (unfortunately !) so I don't believe that it is overloading dropbox.

Here is the stacktrace in case it helps:

Frame    Image             Function                                                   Offset    
0        coredll.dll       xxx_RaiseException                                         19        
1        mscoree3_7.dll    WatsonUnhandledManagedException                            296       
2        mscoree3_7.dll    Dbg_NotifyManagedException                                 93        
3        mscoree3_7.dll    FirstPassException                                         1044      
4                          TransitionStub                                             0         
5                          System.Xml.XmlTextReaderImpl.ParseDoctypeDecl              236       
6                          System.Xml.XmlTextReaderImpl.ParseDocumentContent          776       
7                          System.Xml.XmlTextReaderImpl.Read                          228       
8                          System.Xml.Linq.XDeclaration..ctor                         252       
9                          System.Xml.Linq.XDocument.Load                             508       
10                         System.Xml.Linq.XDocument.Parse                            172       
11                         MC.Phone.Ads.Strategy.RemoteAdProviderStrategy.ParseXml    376       
12                         .__c__DisplayClass19._ProvideNext_b__12                    72        
13                         Microsoft.Phone.Reactive.AnonymousObserver`1.Next          72        
14                         Microsoft.Phone.Reactive.AbstractObserver`1.OnNext         80        
15                         .AutoDetachObserver.Next                                   72        
16                         Microsoft.Phone.Reactive.AbstractObserver`1.OnNext         80        
17                         .__c__DisplayClass27a._Select_b__277                       184       
18                         Microsoft.Phone.Reactive.AnonymousObserver`1.Next          64        
19                         Microsoft.Phone.Reactive.AbstractObserver`1.OnNext         80

Coordinator
Apr 24, 2012 at 6:35 AM

Hi Rupert,

 

Could you share the url to dropbox you're using? Did you place it in the public folder like I said in our previous discussion?

http://wpunifiedad.codeplex.com/discussions/349893

 

Best,

Mark Monster

Apr 24, 2012 at 6:42 AM

Hi Mark,

The dropbox link is http://dl.dropbox.com/u/309185/AdSettings.LI.xml - when I test it from a version deployed to a phone it seems to be OK, and also the version from the Marketplace appears OK, but it would appear that sometimes something is going wrong!

Here is the Xaml from the user control I have written to shown the Ads:

        <Ads:AdControl.AdProviderStrategy>
            <Strategy:RemoteAdProviderStrategy xmlns:Strategy="clr-namespace:MC.Phone.Ads.Strategy;assembly=MC.Phone.Ads"
                                            LocalProviderSettingsUri="Ads/AdSettings.xml"
                                            RemoteProviderSettingsUri="http://dl.dropbox.com/u/309185/AdSettings.LI.xml" />
        </Ads:AdControl.AdProviderStrategy>
Thanks,
Rupert.
Coordinator
Apr 24, 2012 at 6:56 AM

Hmm, the url looks okay to me. But if it's difficult to reproduce I would not recommend using Dropbox. Better use something different instead.

Apr 24, 2012 at 7:08 AM

Hi Mark,

As you say it is difficult to track down what the error actually is - I have not been able to reproduce it.

Would the crash above take out the application as well, i.e. would the control cause the application to exit with an error?

Thanks,

Rupert.