views:

278

answers:

4

Th short story is: I have a Godaddy shared Windows server account and I have some C# code on my computer that runs perfect locally. I want to run this code on the server as an exe file. Is this possible? I do not believe I have command prompt or remote desktop access to my shared space.

More details: The end goal is to have a website who enters data and manipulates data in a SQL database. Both the website and database are up and running. Next, I want to have the above program running in the background in order to send emails based on the information in this database.

It seems that this is not very common, or a very backwards way of thinking about it as I cannot find much relevant help on this topic, any guidance would be great!

A: 

Doing anything like that in a hosted environment would require dedicated or virtual dedicated accounts. Furthermore, be careful with a GoDaddy shared plan because all your .Net apps run in a Medium Trust environment, which can hamper activity.

Eric P
A: 

I am not a GoDaddy user (IANAGDU) but unless your account is a VPS, you probably can't set up the executable to be run. If you have access to the source of the executable, I would pull it into a class library and run it from the ASP.NET app. You can set up a Timer or background Thread on the Application's Start event to run it in the same AppDomain.

gWiz
+1  A: 

With Godaddy you can have cron jobs IF you have a Linux account. For Windows servers you are out of luck.

I don't the frequency with which you need to send emails, but if it is low I have two approaches that could work for you.

You could export your data to a server you control (at home or office) and use it to send the emails. The website would be a gatherer of info and your own system would be the sender.

An alternate approach would be to have a webservice that kicks off the email code and call that from a scheduled app on your local system. An UGLY approach to be sure, but the alternatives are: 1) switch to Linux, 2) switch to a different hosting provider.

jeffa00
A: 

Thanks for all your helpful responses. Just thought I would add Go Daddy's response for completeness.

I also posted a follow up question: How to run a .NET Class Library on a Go Daddy server?.

Thank you for contacting Online Support. It is not currently possible to run .exe files on our shared servers. You would need to be on a Virtual Dedicated or Dedicated Server for this type of support. You can run .NET code from a class library as long as it runs within Medium Trust.

Trust level refers to permissions set in the Web.config file that dictate what operations can and cannot be performed by Web applications. Our ASP.NET 3.5 shared hosting servers use the default Medium trust level with the addition of OleDbPermission, OdbcPermission, and a less-restrictive WebPermission.

Applications operating under a Medium trust level have no registry access, no access to the Windows event log, and cannot use ReflectionPermission (but can use Reflection). Such applications can communicate only with a defined range of network addresses and file system access is limited to the application’s virtual directory hierarchy.

Using a Medium trust level prevents applications from accessing shared system resources and eliminates the potential for application interference. Adding OleDbPermission and OdbcPermission allows applications to use those data providers to access databases. WebPermission is modified to allow outbound http and https traffic.

Please let us know if there is anything else we can assist you with.

Sincerely,

Graham P. Online Support Technician

peter