.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Install a wcf as a windows service and copy files from a network location

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :WCF


I need to intall a WCF as a windows service. In side this WCF , I need to copy files from a network location to the local machine and run them.

I tried to give a specific user account ( which has access to the shared location)for the windows service processinstaller and install the service. but this account cant host the WCF since it does not have admin rights.

Is there a way to host the WCF using local account.. and then to access network location in side the wcf using a specific account. ( impersenation??/ )

Thanks in advance.





View Complete Post

More Related Resource Links

Copy files through batch program on Windows Server 2003

I have a VB6 program running on windows server 2003. When I try to open a file in a SharePoint Document library it will not traverse folders. If I run the application on Windows 7 (maybe Vista too), it can. I assume that there is some operating system helping hand here. In order to get around this problem, we have to output our files to a network share and then copy the files over to the document library manually. My question is, how can I write a batch program that will copy all of the files on a network share to the document library using the individual's credentials? I am unable to map a drive letter to a document library in Windows server 2003 (it works on 7). Any suggestions and tips would be much appreciated. Thanks.

Solved: InstallUtil throws ArgumentOutOfRangeException when trying to install windows service.

This is just to help people troubleshoot the ArgumentOutOfRangeException problem when trying to install a windows service with installutil. It took me a good while to understand the reason of the install failure and I could not find anything about this on the web concerning this problem, so hopefully this will help others in the future so they don't waste as much time as I did.

If you get:

An exception occurred during the Install phase.
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length


1) Go to the deisgner of your ProjectInstaller
2) Select the ServiceProcessInstaller
3) Go to the properties of the ServiceProcessInstaller.
4) If you see Account property set to user, change it to LocalSystem.
5) Rebuild your project.
6) Rerun installutil YourService.exe

Then the exception should be gone and the installation successful.


Sylvain Boissé Software Architect Noesis Innovation www.noesisinnovation.net

Moving directories/files from the server to another network location


In my asp.net wep application i would like to move the folders from the server to a network location so that the server doesnt get filled up...................

i was able to move the files within the same drive but not to other network locations ..........

So please help me in finding a reliable solution

copy a folder and subfolders + files from remote location to local drive



i am making a windows application( C#.Net) in which there is a folder placed at remote location( on other computer). this folder contains files + subfolders inside it. i need to copy all the files and subfolders present inside this main folder to my local drive. How can i do this. 

Thanks in advance

Deveoping Windows Service with C++ and cannot install it



Sorry if i posted in wrong forum.

I am developing my first windows service with C++. I made a new windows service project, added some references in stdafix.h, some code in OnStart and OnEnd and compiled it. 

Then i've ran Earthshaker.exe -Install (obviously Earthsaker being the service project name)

It said alot of stuff (in russian, no use posting here) that can be summarised that service was installed and fixated successfully.

But i cannot see this service in the list of services! I cannot turn it on thus i cannot debug it. 

I tried to run Earthshaker.exe -Install -u and then Earthshaker.exe -Install again, it said it uninstalled, then it said it installed, yet again, nothing changed! Nothing! Service isnt there and i cannot turn it on and make it work.

Microsoft SQL Server 2005 Express Edition Service Pack 3 (KB955706) windows update install error 0xD

I have tried several times to use Windows Update to install the SQL Server 2005 Express Edition Service Pack 3 (KB955706) but it keeps failing.  When I check the install history all I get is error code 0xD59

I have Windows XP SP2 on a Core 2 Duo Dell Vostro 1500

Install Windows Service Error

Hi to all,
I made a Windows Service that I can install fine in my developer machine (Win XP SP2 with Framework 2.0.50727.1433).
But when I want to install the same Windows Service in my production machine I;m getting this error:

   Creating EventLog source WindowsServiceTest in log Application...

   An exception occurred during the Install phase.
      System.Security.SecurityException: Requested registry access is not allowed.
         at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource)
Thinking that is a security/permission error, I change this to use a user that has administrative profile, then when try to install I got an error again:

   Affected parameters are:
      logtoconsole =
      showcallstack =
      i =
      logfile = D:\Test\WindowsServiceTest.InstallLog
      assemblypath = D:\Test\WindowsServiceTest.exe

   An exception occurred during the Install phase.
   System.ComponentModel.Win32Exception: Access is denied
   at System.ServiceProcess.ServiceProcessInstaller.OpenSecurityPolicy()

Really I don't know what to do. Any Help? or idea?
Thanks in advance.

WCF hosted in a Windows Service is not available over network


I have WCF service which is hosted using Windows Service.

Also I have a client (Windows Forms) which communicates with my WCF.

When I test it on my PC (using localhost) it works fine, but when I try to test it over network it doesn't work: I receive the following error: "TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time..."


When I use Windows Forms for hosting my WCF, it works fine.


Here is source code of the service:


var throottling = new ServiceThrottlingBehavior
       MaxConcurrentCalls = Int16.MaxValue,
       MaxConcurrentSessions = Int16.MaxValue,
       MaxConcurrentInstances = Int16.MaxValue

var address = string.Format("net.tcp://{0}", Settings.ServerAddress);
var binding = new NetTcpBinding(SecurityMode.None) { HostNameComparisonMode = HostNameComparisonMode.Exact };


c# windows service - check network folder exists



I developed a windows service running as local system, which will search for some files / folders in specified locations.

The problem is when i specify the Path to a Shared folder in Network it will return "Path Not Found"

how can i fix this.




Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

SqlServer - Windows Account to install Application from Gallery


Referring to this tutorial: http://www.asp.net/webmatrix/tutorials/download-and-install-an-asp-net-application

I selected umbraco cms and got this wizard:

I already have Standard Sql Server 2005 on my machine which I wanted to us for above DB and not SqlExpress.

I did not remember "sa" account pwd nor I use explicitly any account to connect to my Sqlserver. I use Windows Authentication account i.e implicit authentication. So I created new account and gave all rights and used it in the above wizard and was able to install the database after some struggle.

My question is: What if I want to use my Windows Account to install the database above? Why the wizard don't have any option to use Windows Integrated Authentication?

Note: I can create the DB with external user I created, just looking specifics for using Windows Authentication for above installation.

Windows Mobile: Use GPS And Web Maps For Location-Aware Apps


We show you how to build a location-aware task list application for Windows Mobile devices that uses GPS to remind you of a task when and where it's appropriate.

Christopher Mitchell

MSDN Magazine January 2009

Web Service Workflows: Deploy Distributed Business Processes With Windows Workflow And Web Services


Due to the distributed nature of a business process it makes sense for a workflow to be deployed as a distributed application. See how Windows Workflow and Web Services hold the key.

Israel Hilerio

MSDN Magazine October 2006

Service Station: Serialization in Windows Communication Foundation


Windows Communication Foundation supports several serialization mechanisms and provides a simple, interoperable foundation for future service-oriented applications. Here Aaron Skonnard explains it all.

Aaron Skonnard

MSDN Magazine August 2006

Windows Services: New Base Classes in .NET Make Writing a Windows Service Easy


Windows services are applications that run outside of any particular user context in Windows NT, Windows 2000, or Windows XP. The creation of services used to require expert coding skills and generally required C or C++. Visual Studio .NET now makes it easy for you to create a Windows service, whether you're writing code in C++, C#, or Visual Basic. You can also write a Windows service in any other language that targets the common language runtime. This article walks you through the creation of a useful Windows service, then demonstrates how to install, test, and debug the service.

Ken Getz

MSDN Magazine December 2001

More Windows 2000 UI Goodies: Extending Explorer Views by Customizing Hypertext Template Files


The Web-style interface is the default Explorer folder view for the Desktop Update in Windows 2000. The Desktop Update uses HTML-based hypertext templates to create the Web view, and you can customize these templates to include your own views and commands. This article shows you how the Explorer Web view works and how to build your own custom templates for it. You'll see how to add a command prompt and task buttons to a new folder view using HTML, script, and ActiveX controls. The shell object model and thumbnail shell extensions are also examined, then used to build a simple icon viewer for Explorer.

Dino Esposito

MSDN Magazine June 2000

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend