Web Service - Without Precompile

I know that aspx pages can be deployed so that they compile at run time.

<%@ WebPage Source="WebPage.aspx.cs" %@>  (or something like that).

I want to do the same thing with a web service.  I want to put the source code in the IIS directory and make a slight change to it - and have that change take affect without re-compiling everything.

Here are the contents of my current asmx page:

<%@ WebService Language="c#" CodeBehind="SecurityAccess.asmx.cs" Class="JournalSentinel.WorkflowGen.WebService.SecurityAccess" %>

how can I change this to compile at runtime instead of being pre-compiled?
LVL 22
Who is Participating?
NicoConnect With a Mentor Commented:
Hm, I guess you have to precompile anyway then. As far as I know the 1.1 framework doesn't doe on-the-fly compiling.
instead of publishing the webservice, just copy the files to whatever location you want the project to be. .net will always compile stuff on the fly...
_TAD_Author Commented:
That works for .Net 2.0 applications, but I'm afraid this web service was initially compiled in .Net 1.1

In a nutshell, I was told to make a trivial change to the web service (changing an xml field name).  The problem I have is that I suspect before this is all done another 2 fied names will change and I don't want to recompile it for these trivial changes.
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

_TAD_Author Commented:
aspx 1.1 supports non-compiled web pages.  A web service is just a different type of web page.

I'll keep looking.
Honestly to allow the source files to be resident on a production server is dangerous.. this means any malicious access can be used to control your code.

better practice is to complile the Web Service methods and deploy (or copy) the DLL to the bin directory on production.   IIS will detect that the assembly has changed and reload it when it is accessed.
_TAD_Author Commented:
Security is not an issue.  This is not an outward facing web service.  If someone has gotten far enough into our environment to affect this web service, we have bigger problems then who authorized my vacation time (which is the purpose of the web service).
ShazbotOKConnect With a Mentor Commented:
I still stand on the "compile the code and import the assembly" - as this is the best method to use... (security or no security) and technically no the ASMX pages are not a "webpage" ...  if you open the ASMX into designer mode you will be able to note that it is only a "placeholder" so that the IIS knows to listen for that http request.. all communications are interpreted and sent to the aspnet_wp.exe listner wich calls the appropriate assembly.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.