Jerry Warra
Jerry Warra

Reputation: 304

Edit CS file on webserver

I'm running a website (.net 4.5) on a Windows Server 2008 R2 Standard with IIS 7.5. I'm using visual studio 2012 to create the web site and I published it from visual studio 2012.

Now my issue is that the lead guy at my job wants to be able to edit the cs files directly and have the changes propagate to the website without having to run visual studio or recompile the dll and copy it over to the web server. I know this isn't the safest way, but I have no choice but to make it work.

That was how our old website/web servers was setup. I wanted to make it more secure so I went the pre-compiled route and was told not too.

  1. How can I change my current setup to allow this?
  2. Do I have to republish everything? The site is live and I can't interrupt it's use.
  3. I have a class that handles the database connections. Can this be edited the same way without recompiling?

Upvotes: 1

Views: 1229

Answers (1)

Paul
Paul

Reputation: 36319

Direct him to this thread where everyone is saying it's a horrible, horrible idea.

I mean, even in dynamic languages (ruby, node.js, etc) it's a best practice not to change the files in the running web server.

That said, there's a number of ways to do this. Perhaps the easiest is to make use of code in the App_Code folder. Any class files located there will force a restart of the site with changes recompiled in by the framework. I would recommend limiting stuff in there to things he really has a need to change, not just stuff he wants to change.

Upvotes: 3

Related Questions