Shared Hosting <trust level ="Medium" /> - c#

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.
;-)

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.

Hey... Get a VPS... That will let you set your own permission levels. Shared hosting is the craps.
For a while I used Godaddy to host a website, which had a multi-threaded app that ran alongside my website. Godaddy killed it, and then I had to move hosts... NOw i have my own server but it csots me $190 a month. If you want a windows server cheap, you can get one strating $50 a month. I don't know if that's in your budget, but that will give you FULL access to the PC including remote desktop.
I hope this was some help.

Hostgator seem to be the best among the lot.I am using hostgator.

DiscountASP has a shared hosting plan that lets you run at full trust. See their feature list here. Their prices start at $10 a month so it's what you're looking for, I guess.
I've used DiscountASP's services for about a year now and I'm pretty pleased with them. Of course, your mileage may vary.

Related

Hosting a RESTful API

I'm a C# ASP.NET junior dev and have worked with Code First C# Databases, RESTful API's, MVC & Vue (a frontend framework sort of like React) to create websites.
Now at work and during my education, I've never handled deployment.
At this time I have a personal project. I have succesfully hosted my relational MySQL Database on phpMyAdmin and can update it from my local desktop.
My hosting site let me know they do not host C# or anything of the sort.
I found some posts suggesting Azure, AWS, others, but for every post I find I find equal people protesting those.
What is a good site to host my first REST API? I'm looking for something that can go beyond Minimum Viable Product and I'd like to host my website under the hosting service I'm currently using (so not paired hosting with the API).
What would the costprice look like for an API that's deployed and being used by clients?
I realize this cost depends on the amount of traffic, but assume a basic API used for, let's say, posting orders in an online shop (though website/app/w.e, it all would communicate through the API).
Any tips are welcome as I feel I'm swimming in the dark researching this.
Thank you
Any hosting service that grants you real access to a machine will be able to run your API as some specialized for the .net/core ecossystem.
I supposed you know about php based on phpMyAdmin service and the ecossystem of hosts that support php, although cheaper they do not exactly give you access to the machine and probably will not support .net/core as inumerous others tech stacks.
As a Junior Developer I believe you should have a little bit of practice in any deployment ecossystem so I encorage you to try most of the big clouds (Azure, GCP, AWS), but also some smaller hosts to gain experience and understand a bit more about the differences in deployment and ecosystem.
Azure will be really easy, you can create an account and post your API without any costs using an free WebApp, VS will even have publishing tools that will handle 90% of the job, GCP will be a little trickier and will require you to know a bit about containers and clusters, if you go for a non specilized host like digitalocean you will need to understand more about the Operational system and associated servers/controllers to deploy and publish
about the cost part is a lot more difficult. It will depend on the host that you are using and the load (process, memory, size, and throughput of data). In my experience I had some very small-scale APIs that required more processing or memory to accomplish some tasks like PDF generation than a medium-scale API that only had json data transaction

Windows service not able to hit network drive path asp.net

I have one windows service which used to place files on network drive. It is working fine on some machines but on some machines it is not working fine. Although when i am trying to do with Window application it is working fine.
Please suggest me how i can solve this issue. As there are more than 100 of systems where this service installed but I am getting this issue random basis.
Thanks all for your valuable comments.
I found one more thing and this is definitely missing from Networking team. They had provided the access only on child folder not on the root folder that's why service was not able to hit mapped directory.
After provide the full permission to root directory, service is able to place files.
All possible scenarios which provided in comments will also be helpful for me to solve issues related with same domain.

SQL Network Interfaces, error: 50

I just published my ASP.NET Website on IIS and have already configured it to be working, everything is running smoothly.
Except.. I can't accept the App_Data file where all my database information is stored. That might not be the only folder that i can't access but maybe possibly App_Code too? Where i place all my Data Access Object classes (CRUD).
I searched high and low on blogs, articles and stackoverflow but i still can't find the solution to accessing the folders.
I also read that by default certain file extensions are being blocked by IIS.
Is there a possible way to solve this?
Web.config
Error
I read that changing (LocalDB)\MSSQLLocalDB to something else might work?
I'm not sure exactly..
Appreciate any help please.. I'm relatively new to IIS and this is my first published website running on localhost.

controle service on remote server with custom c# utility

I have a problem I hope you bright guys can answer for me:
On server “A” I have a service running that sometimes needs to be stopped or restarted for reasons I can’t control. The service is run by a dedicated network user, say “serviceusr”, that is a member of the domain.
The problem is, that in some installations, server “A” resides in a hosted environment without direct access to server “A”. I have access to server “B” through RDP, that resides on the same network and in the same domain.
My idea is to create a small utility in C# that can be installed on server “B” that can impersonate “serviceusr” on Server “A” to start and stop the service. The “serviceusr” must have rights granted access to start and stop the service, and this is no problem to obtain.
I have scoured the internet for hints and samples that could lead me on the right track, but haven’t found the “holy grail” yet. I have found a number of samples that claims to be able to do the job, but none have done the trick. I tried to tweak and/or combine them to the best of my abilities without any further progress. It seems to me that it isn’t possible to impersonate “servieusr” on server “A” from server “B”.
My question to you are: Is my idea even possible?
And if it is, all kinds of hints, links or sample code on how to implement would be really great.
Thanks for the help in advance
/Morny

CS0103: The name 'xxxx' does not exist. This randomly occurs

I have researched this quite a bit and while I can find a number of articles on the general issue and the code, unfortunately none quite like what we have.
Environment: We have 2 web servers running Windows 2012 and IIS 8. All running .net 2-4.5
Web Server 1: This is our main server that runs our main websites and web applications
Web Server 2: This runs our client websites
Code: Both sets of code are uncompiled. Both the shared code and the client websites are .NET 4 sites.
Scenario
On Web1 we have a set of website code that is shared amongst a number of client websites. On Web2 the client site is set up in IIS and a sub directory of the App_code is a virtual directory pointing to a folder in the shared code on web1. We also have another virtual folder that points to the Web1 code as well. We have over 100 websites running in this fashion for over a couple of months.
Recently a couple of our clients have contacted us to say that they are receiving an error when browsing to parts of their website that are served by these virtual directories. The file that it references in the error message is in a modules folder in the virtual directory. it is a .cs file.
It only seems to be one website at a time and if we make a change that forces IIS to 'recompile' the site (meaning that we make a slight change to the web.config, save it and then change it back and save again), the error disappears and the web site starts working correctly. When we check other sites that are in the exact same setup as the one failing, we do not get any errors and they work correctly.
We are whits end as the issue seems to be completely random. This issue has only started occurring in the last week or at least this is the first we have seen of it.
We are at the point where we believe that it might be an IIS 8 issue and something that might be occurring when it is trying to recompile a client web site but due to the randomness and the 'easy fix' it is difficult to troubleshoot or even know where to go looking for the issue.
Any help would be much appreciated.
Thanks
Don
What is the error you're having? Based on what you said, the behavior is random and points on a C# file, not much can be said and only guesses could be make...

Categories