Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WCF Win2008 Win2008-R2 , +
So I'm wondering if there is a way to expose a Managed Windows Service on Windows Server without IIS?
 
we had a working sample for an admin user, however because this is an ADFS type situation, when any other user attempts to access the SVC they are shot down (500);
 

(links or even specific search topics are good)
Posted 18-Mar-11 5:09am
ely_bob3.6K
Comments
ely_bob at 18-Mar-11 10:22am
   
it's maybe possible if you open up "everyone" for install privileges on the server, then install, close "everyone" .. say 25% chance of success?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

First of all: Windows Service itself have nothing to do with IIS at all. This is just a general-purpose Service hosted by OS in a special way — using Service Control Magager, see [^], http://en.wikipedia.org/wiki/Service_Control_Manager[^]. With a managed platform (.NET) it can communicate with applications and other services on the same or remote machines using number of ways: WCF or remoting, low-level sockets, named pipes (on the same system) and more.
 
It is not clear what do you mean by "ADFS situation", most likely, you mean "Active Directory" (if disambiguation is still needed: http://en.wikipedia.org/wiki/ADFS[^]). So what? You can use it, too. "SVC" also needs disambiguation. Is it "Service cannot start" of what? Where is your code? How the problem is manifested? Please describe your problem with sufficient level of detail and… try to use less abbreviations.
 
If your want to find bugs in a Windows Service, you need to catch all exceptions at the top of stack of each thread and log them properly. The most reliable way of logging is the System Event Log.
Find some code samples of System.EventLog here:
How to create event log under a folder[^]
MsBuild OutPut to the TextBox on the fly in Windows Application[^].
 
Using debugger is also quite possible, you should be able to attach the debugger to existing already running process. Refer to debugger documentation. It need thorough planning of your debugging session, otherwise you will miss the problems if they occur in the very beginning of the Service start.
 
—SA
  Permalink  
v3
Comments
ely_bob at 19-Mar-11 12:18pm
   
The problem is making a service endpoint on a server which is exposed to an intranet, where the server CANNOT leverage WAS/IIS, but could potentially use HTTP.sys(?) to expose an *.ashx, *.scv endpoint.
 
You cannot use a system event log if you cannot get access into the WindowsService that runs the code to do the logging.
 
This isn't a code question it's a systems architecture/Implementation plan question. the code is trivial.
SAKryukov at 19-Mar-11 15:11pm
   
I really don't understand what prevents using EventLog. I did not mean you need to "access" anything. I mean Windows Service itself can use EventLog.
I don't see big architectural problem here (and I cannot say the code is trivial). I don't think you explain the problem. What is it, after all?
--SA
ely_bob at 20-Mar-11 12:15pm
   
So you have 2 ways to run code that can be executed from off the MACHINE, A) as a WindowsService (code trivial)B) as a handler(ASHX)/service(WCF(REST/SOAP)).. In the case of A: for a call to be made from the intranet webform solution you must access the MACHINE as a user who has execute privileges, which is automatic with IIS/WAS, for all users, but is not possible AFIK to implement a secure everyone implementation of a WIndowsService...(note there are two different services that are being discussed in this post, WindowsService and WebService (in the spirit of WCF))
 
So yes you can run a WindowsService, but only if you are accessing the MACHINE as the appropriate user, which IIS takes care of for you behind the scenes.. is there a way to do this WITHOUT IIS/WAS?
SAKryukov at 21-Mar-11 0:09am
   
I cannot understand you. "So yes you can run a WindowsService, but only if you are accessing the..." Windows Service is exclusively a notion of a local machine. There is no such thing as "visibility" of Windows Service.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 329
1 Maciej Los 290
2 Sergey Alexandrovich Kryukov 230
3 Shweta N Mishra 185
4 PIEBALDconsult 149
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,760


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 18 Mar 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100