Error accessing RSS feed from Silverlight with WebClient() - silverlight

I'm downloaded the code from John Papa's book here: http://silverlight-data.com/
and am sucessfully running the Chapter 7 example which allows you to press
a button and it reads RSS from digg.com and then displays it.
So, then I replaced the digg URL
http://services.digg.com/stories/topic/microsoft/?appkey=http%3A%2F%2Fwww.silverlight-data.com&count=20]
with my RSS feed:
http://tanguay.info/web/rss
but I get this error on the DownloadStringCompleted event:
Result 'e.Result' threw an exception of type 'System.Reflection.TargetInvocationException'
Error = {System.Security.SecurityException ---> System.Security.SecurityException: Security Error
bei System.Net.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
bei System.Net.BrowserHttpWebRequest.<>c__DisplayClass5.
I tried other RSS feeds, e.g.:
http://news.google.com/nwshp?hl=en&tab=wn&output=rss
and I get the same security error.
What can I do to avoid getting these errors so that I can consume these feeds from Silverlight?

If you try to access a website/url that differs from the url your silverlight application is run under you will need to set up a cross site policy file or access a site that has one allowing access.
Silverlight Cross Domain Policy File Checker
Silverlight cross domain policy file helpers
[edit added Tim Heuer's links]
HOW TO USE CROSS DOMAIN POLICY FILES WITH SILVERLIGHT
WORKING WITH SYNDICATED DATA

Also please see http://silverlight.net/learn/learnvideo.aspx?video=65672 and http://silverlight.net/learn/learnvideo.aspx?video=47174

Related

What resource URL should I use for SSO-based local sideloading of Excel add-in?

I have an Excel add in that works perfectly with SSO for my published add in - but when I sideload locally, I get:
err: Invalid application resource Url provided - Invalid resource Url
specified in the manifest. code 13004
How do I know what resource Url to use when running locally?
From your error message, the most common problem is that the Resource element (in the WebApplicationInfo element) has a domain that does not match the domain of the add-in. Although the protocol part of the Resource value should be "api" not "https"; all other parts of the domain name (including port, if any) should be the same as for the add-in.
Error 13004
Validate an Office Add-in's manifest
If this doesn't help resolve your issue, can you share any documentation that you followed when adding the Excel add-in, so I can gain a better understanding of your issue.

Hosting Company under cyber attack!! Can I fix this myself or do I wait for the hosting company?

Our hosting company MijnHostingPartner.nl got hit badly by a cyber attack and most of their client's website have been down for weeks. I am a complete noob in coding, just working my way around it by using DNN to build a website. I've set up all the MSSQL DB's correctly and it's running smoothly for over a year now.
Since it's used daily by a small community of ten pin league bowlers - all results and news are displayed here - I'm getting quite the amount of complaints since it's down!
This is the error I get on both top-level as sub-level domains:
Server Error in '/' Application.
No http handler was found for request type 'GET'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: No http handler was found for request type 'GET'
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): No http handler was found for request type 'GET']
System.Web.HttpApplication.MapIntegratedHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig, Boolean convertNativeStaticFileModule) +748
System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) +589
[HttpException (0x80004005): Error executing child request for ~/ErrorPage.aspx.]
System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) +1295
System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm) +72
System.Web.HttpServerUtility.Transfer(String path) +45
DotNetNuke.Common.Initialize.CheckVersion(HttpApplication app) +845
DotNetNuke.Common.Initialize.InitializeApp(HttpApplication app, Boolean& initialized) +154
DotNetNuke.Common.Initialize.Init(HttpApplication app) +157
DotNetNuke.HttpModules.RequestFilter.RequestFilterModule.FilterRequest(Object sender, EventArgs e) +258
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +139
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +88
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3282.0
Does anyone have a clue what I'm talking about? 'Cause I sure don't. Please, if you explain it to me, explain in a way your dog would understand, if that's even possible.
Many thanks,
Robbe
If you are using a third-party hosting solution I would guess that you don't have the ability to change the values referenced in the comments section.
This error appears to be a very low-level issue with the server not being configured for ASP.NET hosting. (The underlying technology used by DNN.)
I'm not confident that you will have the ability to fix this without them. However, you have a few options.
Get the information on this error to the hosting provider. The key will be to determine if ANY services work A great check is to see if you can get the DNN Keep Alive to work. You can get to that via http://yoursite.com/keepalive.aspx
Extract a copy of the site files & database and move to another host. This is typically an easy option, but I would caution you that it would be prudent to have the site scanned for any potential malicious impacts PRIOR to moving to a new hosting provider unless you know for sure what the impact was to your hosting provider.
This is never a good situation, but one that you should be able to get past. If needed, this could be a time to reach out to someone that knows this stuff well, as there are a lot of little risks associated with a potentially compromised solution.

Silverlight trying to access local crossdomainpolicy.xml

I have a Silverlight app that I developed locally, and I'm trying to run it on a Windows 2008 R2 server that I personally setup. Everything smooth and dandy, except that when I try to auth on the app, it tries to look locally for
http://localhost/crossdomainpolicy.xml
http://localhost/clientaccesspolicy.xml
It also throws a nasty error :
Uncaught Error: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at SomeService.MVServiceReference.CheckUserCompletedEventArgs.get_Result()
at SomeService.Pagini.Autentificare.AuthForm.webServiceSoapClient_CheckUserCompleted(Object sender, CheckUserCompletedEventArgs e)
at SomeService.MVServiceReference.MVWebServiceSoapClient.OnCheckUserCompleted(Object state)
If your XAP file is on http://localhost/somewhere/somefile.xap it shouldn't look for a clientaccesspolicy. Are you using the ASP.NET dev. server to host the Silverlight app while you are using IIS for a WCF service that is called by the silverlight app?
Silverlight's inability to present exception details is well known. It is due to the fact that all communication from a Silverlight component to a service utilizes the hosting browser and when there is an error returned with a http error code, the browser only returns the error code and not the message containing the exception details to silverlight.
Activate WCF trace logging on the server side and look in the svc-log to get the real exception message.
For crossdomain purposes, http://localhost/ , http://localhost:1234/ and http://localhost:4321/ are all different domains.

Silverlight 4 HttpWebRequest user agent string is null

The problem
I have a page with a silverlight object. It attempts to retrieve XML from another (external cross domain) page. But I am struggling with a security exception.
I have this code working brilliantly in WPF.
When using a website hosting a silverlight application with the same code, the user agent string of the HttpRequest object is null (and seemingly cannot be set). In fact there is no header information at all - this causes a security exception when attempting to make my asynchronous call.
The question
Why is the user-agent string (and header information) null in my silverlight 4 application when making an asynchronous call using HttpWebRequest?
Thanks in advance!
sounds like you are might be hitting a cross domian issue
does your external xml have a clientaccesspolicy file or a crossdomain file on the site?
http://msdn.microsoft.com/en-us/library/cc197955(VS.95).aspx
Also what is the exception ? can you post.
Update:
OK, Have looked and run your code and yes it a crossdomian issue. The site "http://eu.wowarmory.com/" has a crossdomian file but only allow access from the sites listed in that file ? is you site one of those ? If not you are hitting crossdomain security. (WPF runs on the full CLR and so does not have these restrictions.)
There are options ...
-Silverlight 4 running in elevated trust is one - but that is OOB
-Doing it in Javascript and the passing the data into Silverlight
-Get you server to do the work for you i.e. proxy
-Get them to change the crossdomain file !
There are others it really depends on what you are trying to achieve overall? can you explain more ?

Launch Error in Expression Blend 2

I get an exception error when I F5/Build any Silverlight project within Expression Blend 2:
Launch Error
Could not start ""
due to the following error: System.ComponentModel.Win32Exception: The
system cannot find the file specified
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo
startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at Microsoft.Expression.Project.ExecutableProjectBase.Execυte()
Googling seems to suggest it can be an incorrectly configured dev server.
Here's a Blend Configurator
Here's the post that let me to it
If this doesn't help try the following:
Remove the Silverlight project reference in your web app's properties pages, rebuild, add it again.
Ensure the virtual directory or other path your web app is running under (Project URL: http://localhost/mysilverlightapp for example) actually gets you to it. Hit 'Create Virtual Directory' if not. See if it does now.
Check that your page with the silverlight control has the correct file name for your Silverlight dll.

Resources