C# – Shared Hosting

asp.netcweb-hosting

I'm a bit surprised that this isn't on more forums as it is a total show stopper.
I have a ASP.NET app that calls a web service I wrote. It is hosted on a shared hosting site. Recently the company moved my server to allow for both 1.1 and 2.0 applications. The trust level has changed from 'full' to 'medium' and my code has stopped working. The company will not make any changes to their machine.config file or add my web service as an endpoint. I can not override the setting in my web.config file and I cannot set the originUrl in my web.config file.

My client's small business site is now off-line and she will go out of business.

I have upgraded my code to 2.0 and in my web.config files I set the trust level to "Medium" (I learned that lesson the hard way) but even on my development machine I canot get past the call to my web service. I get the
"System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

I have read that I should be able to 'code around' these issues but I have no idea where to even start.

Has anyone any idea on what I need to do to get my code working on a totally locked down hosting server where no changes to my config file are allowed…

The best bottle of the best whiskey I can buy to the person who helps me find a solution to this.
😉

Best Answer

It sounds to me like your web host is not very flexible. I would ask them about adding the needed permissions they allow. I had the same problem with Server Intellect and after speaking with them and telling them the permission I needed, they helped out and worked it out.

Honestly though, there are a lot of hosting companies and a lot who are willing to work with people to get their business. If I were facing the same difficult hosting provider, I would look elsewhere to a provider that will help you out. The change they made caused you pain and they should at least attempt to help you, otherwise move on to someone who wants to support you. Just me 2 cents, probably not a recommendation you were looking for.

Related Topic