Comments (4)
Changed ticket status to "Started".
Original comment by [email protected]
on 9 Jul 2008 at 3:35
- Changed state: Started
from aspnetserve.
You could use this Windows service library for hosting it:
http://www.hoytsoft.org/serviceBase.aspx
It takes care of UAC in Vista (and later) for you. For example, to host a WCF
service, all you need to do is:
public static void Main(string[] args) {
bool pleaseStop = false;
ManualResetEvent evt = new ManualResetEvent(false);
ServiceBase.RunService(args, new SimpleService(
"WCF_Server",
"WCF Hosting Service",
"Hosts a WCF service",
null,
/* Start */
delegate(SimpleService Service, object Param) {
ServiceHost selfHost = new ServiceHost(typeof(WCFHost),
serviceURI);
try {
selfHost.AddServiceEndpoint(typeof(IWCFHost), new
WSHttpBinding(SecurityMode.None), "WCFService");
ServiceMetadataBehavior smb = new
ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
selfHost.Description.Behaviors.Add(smb);
selfHost.Open();
//Wait until we're asked to stop
while (!pleaseStop) {
if (Service.Debug) {
Console.WriteLine("Press <ENTER> to
exit");
Console.ReadLine();
Service.ServiceTestStop();
}
evt.WaitOne(10 * 1000, false);
}
selfHost.Close();
} catch (Exception ex) {
Debug.WriteLine(ex);
} finally {
selfHost.Abort();
evt.Close();
}
Console.WriteLine("Stopped");
},
/* Stop */
delegate(SimpleService Service, object Param) {
Console.WriteLine("Please Stop");
pleaseStop = true;
evt.Set();
}
));
}
Original comment by david.g.hoyt
on 15 Jul 2008 at 5:19
from aspnetserve.
I also have an extensive XML configuration library that complements this very
well.
It already has support for connection strings, forms authentication, url
rewriting,
e-mailing (w/ templating), localization, etc. on a per-machine basis. IOW, you
can
create a basic configuration, and then choose to override sections on a
per-machine
basis (e.g. the connection string is different on different machines). Plus
it's
easy to add new, type-safe settings. Let me know if you're interested. It's
licensed
under the CPOL (http://www.codeproject.com/info/cpol10.aspx), so it's very
liberal
and shouldn't clash w/ your license.
Original comment by david.g.hoyt
on 15 Jul 2008 at 5:29
from aspnetserve.
I have completed the windows service.
Original comment by [email protected]
on 18 Jul 2008 at 3:22
- Changed state: Fixed
from aspnetserve.
Related Issues (16)
- HTTP Persistent Connections Unsupported HOT 3
- Packaging Abilities HOT 9
- Remove GAC Install Dependency HOT 3
- Empty responses with bigger files HOT 3
- Broken Under Windows XP HOT 2
- WebApplicationPackage does't extract zipfiles properly. HOT 1
- Saved pages don't load.
- Support for .NET 4
- Limited Support for "Web Application" Projects HOT 1
- Server Authentication Modes HOT 3
- MIME Types For Static Content HOT 2
- Why a new webserver? HOT 1
- AspNetWork.GetProtocol() Is Unimplemented HOT 2
- HTTPS Support HOT 1
- Name Based Virtual Hosting HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aspnetserve.