access HttpContext.Current from WCF Web Service

You can get access to HttpContext.Current by enabling AspNetCompatibility, preferably via configuration: <configuration> <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled=”true”/> </system.serviceModel> </configuration> That in turn allows you to get access to the current user: HttpContext.Current.User – which is what you’re after, right? You can even enforce AspNetCompatibility by decorating your service class with an additional attribute: [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)] … Read more

Linux: process into a service

That depends on your system manager the most common way to do that on debian/ubuntu is to build an initscript and place it in /etc/init.d or /etc/rc/init.d and place a script named mytestprogram in that. this is an example initscript: #!/bin/sh ### BEGIN INIT INFO # Provides: testone # Required-Start: $local_fs # Required-Stop: $local_fs # … Read more

.aspx vs .ashx MAIN difference

Page is a special case handler. Generic Web handler (*.ashx, extension based processor) is the default HTTP handler for all Web handlers that do not have a UI and that include the @WebHandler directive. ASP.NET page handler (*.aspx) is the default HTTP handler for all ASP.NET pages. Among the built-in HTTP handlers there are also … Read more

Android Location listener in Service does not work until I reactivate WiFi/mobile network

You could use new location provider (FusedLocationProvider), which combines info from different location providers, so if your device has any possibility to obtain location, You’ll get know it. Of course, You should enable in preferences for your device to use location info by apps. Check developers.android.com for extended info about this provider. This is solution … Read more