Silverlight WebRequest/WebClient SecurityException issues with local file system - silverlight-4.0

I've stumbled across a few sources that state that silverlight cannot execute web requests when running from a local file, ie. using file:// instead of http://.
The problem I have is that we're using a sidebar gadget to host our silverlight app. Previously we were using WCF but now, when trying to include a RESTful json service, we can't due to this restriction.
Is there any workaround for the limitation of not being able to execute web requests when executing silverlight from the filesystem?
Edit - Update
I've stumbled across the term Cross-scheme to describe this sort of request, but it doesn't seem like it used to be supported, not sure about Silverlight 4.0. This is catastrophic for us. Any help or workarounds?

Related

Deployment error: "The requested page cannot be accessed because the related configuration data for the page is invalid"

What happens?
I publish a website to UnoEuro on a windows server.
When I do I keep getting the error message:
"HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid."
What have I set up/tried?
What I've done is that I've created a .NET Core 2.1 Web API which hosts fine locally on my computer using IIS. I have then published the web api to the hosting site UnoEuro where I can see that the files are uploaded as they should be.
I asked the hosting sites support, they told me to just ensure that it was deployed as self-contained but that otherwise they could not help further. It looks like there is a hosting issue of some sort related to that it cannot seem to find the webconfig file. At least that's what the error message says.
Is there any form of setup I should make? A configuration I should change? Should I set up some SSL settings in the web API which I might have missed? When I started the project I told it to enforce HTTPS, but surely I should get another error message if that was the fault?
I've tried publishing with the target runtime set to both x64 and x86.
I've never published an API like this to anything but Azure before, so I might be doing a thing or two wrong but I cannot see what it should be? I have Googled around but not found anything that seems relevant which has worked.
Most of the solutions seem related to changing the server environment which I don't have so much control over, I mostly just have control over the application/web api, at least that's what it looks like to me.
Hope you have any suggestions, I'm all eyes n ears.
Side question: Should I use IIS Manager for this? I'm currently publishing through Visual Studio 2017.
Images for further understanding
Publishing settings
Deployed/published files
Error message I get
EDIT:
I tried moving the files to /public_html on the same domain as ISS Manager seemed to indicate it expected the config file to be there.
That then resulted in a different error message as you see below.
Link from error message: https://go.microsoft.com/fwlink/?LinkID=808681
It's hard to say exactly, but I think the issue is that the ASP.NET Core hosting bundle is not installed on the server. There's two pieces to hosting in IIS. First, you need the .NET Core runtime, and then you need the ASP.NET Core hosting module for IIS. Deploying as self-contained buys you the runtime, but not the hosting module in IIS. There's non-standard sections in the Web.config created by publishing an ASP.NET Core app. The hosting module shims in support in IIS for these config sections (among other things). Therefore, the config error seems to imply that this is not happening.
If you don't control the server, there's not much you can do about it. Honestly, at this point, I wouldn't host anywhere where you do not at least have some measure of control over the environment. You can get a full VPS from numerous hosting services for $5 or less a month. Either continue hosting in Azure, or look into other respected cloud providers like DigitalOcean, AWS, etc.

Silverlight and WCF error

I am working at silverlight application and my ask is about wcf and silverlight..
I crated silverlight app and wcf library in one solution..
Then linked service to app via Add service reference..
When I start only service, it's working without problem..
Problem just start when I want to run application.. I've got error about client access policy, which I have add as well..
So my ask is: Is there a way how to start app (and debug) and service together witout that error? and without duty to deploy? Only in debug mode?
The clientaccesspolicy.xml and/or crossdomain.xml files are not required inside your client application, and they do not belong in your web service directory. Rather, they must be copied into the root of your web server. Mostly, that would be the directory C:\inetpub\wwwroot instead of C:\inetpub\wwwroot\PDFService.

clientaccesspolicy.xml suddenly stopped working (WCF/Silverlight)

Very frustrated with all of this, hoping someone can assist.
I had a Silverlight application and WCF working together without issue for a year. In order to get them working, I had some pain initially but finally worked through it with help. All of the pain came from configuration/security, 401's, cross-domain hell, etc.
The way I have everything setup is that I have a WCF service that resides in it's own application/directory and runs in its own application pool.
On the same web server (IIS7), I have another application/directory with the Silverlight application that points to the aforementioned service.
The server name (for this exercise) is WEBSERVER1. We've created a CNAME for it that is WEB1. In the past, if the user went to http://WEB1/MyApp/ or http://WEBSERVER1/MyApp/ it would work. Suddenly yesterday it started behaving badly. Normal users started getting the Windows challenge/response prompt (and even if they entered the info they would get a 401 error).
My WCF service runs in a site that enables anonymous access (and this has always worked).
My Silverlight application runs in a site that has windows integrated (and this has always worked), since I capture the Windows username when they connect.
For the record, I did create a NEW application pool yesterday with an ASP.NET application that runs in it. This seems to work fine, but there is a chance creating this new application pool and application/directory has caused something to change.
I have a clientaccesspolicy.xml in my wwwroot folder, as well as in the folder for each of the two applications above (just in case). I have tried to promote NTLM over Negotiate as a provider (as that worked for another issue I was having on another server).
After trying some changes, I can't even get the thing to behave the same each time I call it. Sometimes it will prompt me for credentials. Other times it will work, but then say it failed to connect with the WCF service with a "not found". Other times it will actually work fine, but only if I am using the actual server name and not the CNAME. When using the CNAME I always get the crossdomain error, even though I have the cross-domain xml files in every directory root.
This is a nightmare, and makes advanced algorithm analysis seem fun and easy by comparison. Did Microsoft realize how difficult they made this combination of (IIS7/WCF/Silverlight/providers/permissions/cryptic or missing error messages) to get to work??
I found a solution that appears to be working.
In this case, I had to change the authentication mode for the default web site (which hosted the clientaccesspolicy.xml file) from anonymous access to Windows Integrated. I don't understand why this worked for a year or so and then stopped, but it seems to have resolved it.
The new application that I had deployed yesterday was a standard ASP.NET web application, which I put in it's own application directory and it's own application pool, to ensure that it would not cause this sort of issue. I'm still not even sure if it did.
The way I resolved it was by trying to navigate from my PC to the actual http://servername/clientaccesspolicy.xml file, and that was giving me a 401 error. I switched from anonymous to windows integrated on that default website (which has nothing in it except for that xml file) and that resolved the permission issue. I then had to permission the actual AD groups to have read access to that folder (if not they got the user/pw prompt and could not get through).

Monodevelop - Update the URL of a web reference

I have a monotouch application which accesses a WCF web service. This application is built within Monodevelop.
I have recently released a new version of this webservice. I.e. from http://localhost/v1/webservice.asmx to http://localhost/v2/webservice.asmx.
I need to update the url of web service in my Monotouch app and update the reference so that I can access the new methods. There does not seem to be a way to do this via monotouch. What is the simplest way to accomplish this task short of deleting and re-adding the reference?
That does not seem possible via the GUI indeed.
It seems that the URL is stored in Reference.svcmap.
You could try editing this file, then running Update Web References. I have not tried though.

RIA: "Use local IIS Web server"

I know I've had this problem when I started working with Silverlight, but I can't for the life of me remember how to fix it.
I created a new RIA service application using the standard tutorial, added a table from the database and added a grid to display the results. Works great. Now I pull open the Web properties and change the web project to "use local IIS Web server". Suddenly the application will load up and give me the friendly "NotFound" error.
Please, someone remind me what I'm missing here.
I ran into this problem recently, and resolved it with help from this post on the silverlight.net forums.
Basically, I had Windows authentication and annonymous access enabled at the same time, and I need to disable windows authentication and restart IIS.
John
Not sure what the missing part is but I always start with Fiddler as will show the messages going across the wire. The actual messages can contains far more useful that the browser is hiding from the Silverlight plugin