VS 2008 Where To Store Settings For Windows Service

May 13, 2009

I've written a windows service in VB.NET 2.0 and the service needs to know a few file paths and other settings when it starts in order to be able to do what its supposed to do. These are settings that users of my service need to be able to configure themselves so I cant hard code them in.At the moment I just have the service look for a file named Config.INI in the same directory that it is being run from and if this file exists it attempts to read the settings in from there... this works perfectly, but it just feels a bit clunky and old. If it was a normal windows app I would store the settings in an XML file in the user's application data folder or something but as this is a Service then thats not possible as it is not run by any one user (well technically it is, the Local System account). I then thought about using the registry but I seem to recall people saying that you should avoid storing settings in the registry if you can really, especially with the new security in Vista and Server 2008.

View 6 Replies


ADVERTISEMENT

Storing Settings For A .NET Windows Service: Service Property Settings, Serialization?

Aug 5, 2010

I am working on a .NET Windows Service where I am trying to store settings that will be used when the service is started and while it is running. I have searched through posts on SO and found that using the Settings in the properties of the project is great for use with console and winforms applications. However, Google and SO are silent when it pertains to storing these settings with a windows service.

View 4 Replies

Location Of Windows Service My.Settings

Sep 22, 2011

I have a VB.NET solution built in Visual Studio 2010. It consists of a class project, a service, and a setup project. I have successfully created a setup, and run the setup from the "Release" directory of the setup project (outside of Visual Studio). It installed the service (on the same machine as where the project is), and the service seems to be running fine. The service executable is installed in a directory under c:program files (x86) along with some DLL's it is dependent of. The service (actually the class project I mentioned above) uses some settings from My.Settings. As far as I know these settings are stored in a app.config file in the project directory, as well as in a settings.settings file in the My Project directory under the project directory.

Neither of these files are installed by the installer. But the service can only run if it can read the settings. So where does my service get these settings from? To check if it still reads the settings from the VS project directory, I have temporarily renamed that directory, but that didn't affect the correct operation of the service.

View 3 Replies

Configure Service Settings In Windows 7 Programmatically?

Dec 30, 2010

If you edit a service in Windows 7 and go to the Log On Tab, there is an option to "Allow service to interact with desktop". I'm trying to ensure that it is set for a certain service using VB.NET.

Note: Doing this during the install of a program is not an option. It has to be done at run time.

View 2 Replies

Use Window Form App To Manage Windows Service Apps My.settings?

Aug 26, 2009

I have a solution with two applications in it. One is a windows form application that I want to use to set and manage a windows SERVICE application app settings.

For example. The form has the database connection string on it, when updated. The windows service application settings are updated.. I can get it to work for the windows application, but I need to jump boundries to the other application( Windows Service) and update the app settings there.

View 5 Replies

VS 2008 Settings Store A 1-Dimensional Array?

Feb 15, 2010

I'm working on a program that generates random values for a byte array thats length is 16.I have already devised the generation method, but I want to use My.Settings to store this...but I haven't seem to have located Byte() for My.Settings.

View 2 Replies

VS 2008 Store Some Configuration Settings With Time

Mar 20, 2011

I am developing an application, and i need to store some configuration settings, with time, i will need to add some more configuration settings. Am thinking of three alternative to implement that will me easy to access without much coding and efficient sqlite, xml, and application configuration file..But am concerned about security, because some personal data will be saved together.

View 2 Replies

[2008] Store Comnnection String In My.Settings?

Jan 12, 2009

how to store the connection string to my Access mdb in my project's My.Settings ?

View 4 Replies

VS 2008 Store Global Variables, In My.Settings Or My.Namespace?

Dec 4, 2009

Which is the best way to store global variables, in My.Settings or My.Namespace. The reason I ask is because I need to know certain boolean values if certain forms are open from other forms. At present I am defining Global Boolean variables in My.Application, which give the result I require.

View 3 Replies

VS 2008 - Store The Connection String In A Settings Table In The Database?

Apr 20, 2010

I am storing my connection string in my app.config file. I am using sql server express 2005. The connection string on my dev machine is different from the ones at the clients. so each time I update I open the config file and edit the connection string setting. This is quite a pain.also I have now published my app to an ftp folder so that the clients can get the updates each time I make changes. saves me the hassle of going to them each time i update. so now i need it to be so that I won't have to change the setting all the time.Would the best way be to store the connection string in a settings table in the database?

View 6 Replies

C# - Error "Settings To Access Printer 'printername' Are Not Valid" When Printing From Windows Service?

Apr 27, 2010

I get the error mentioned when printing to a network printer.The error does not occur when run under XP/Win2003, in a WinForm app or when a local printer is used.The error does only occur when run as a Windows Service under Vista/Win7/Win2008 and printing to a network printer.The Windows service runs under a network user that has access to the network printer. Before I print I check if the printername (including network path) is ok by looping through the available printers.

View 1 Replies

VS 2008 Create Windows Service Using Windows Form Common Control?

May 3, 2012

It is possible to create windows service using windows form control in vb.net. give me the url or links. The windows forms control such as, Timer control, list-box, notify-icon control etc.

View 1 Replies

.net - WCF Service Hosted In A Managed Windows Service Connect Using A WCF Service Application

Jul 14, 2011

i have a Windows service that is hosting a WCF service through net.tcp and this is working great. I have also created a WCF service application. I am trying to add the net.tcp service reference to the service application. Then I add it to the GAC that goes ok but if I try to RegAsm the WCF service application to allow it to be called from Server.CreateObject I get the error:

Warning: Type library exporter encountered a type that derives from a
generic class and is not marked as
[ClassInterface(ClassInterfaceType.None)]. Class interfaces cannot be
exposed for such types. Consider marking the type with
[ClassInterface(ClassInterfaceType.None)] and exposing an explicit
interface as the default interface to COM using the
ComDefaultInterface attribute.

It does not work. I have tried to call it through a class library but this does not work either as the end point is not set correctly.

View 1 Replies

Store Three Items In My.Settings / Where Are My.Settings?

Jun 28, 2010

I store three items in My.Settings. One is a serialized string, and the other two are GUIDs. When the main form starts, those three items are loaded into various places. On rare, and so far unpredictable, occasions, one of these GUIDs is notably absent. The others may or may not be, I have yet to be able to check. Since it happens so infrequently (twice this month, though I have been working on the code every day), I'm having a very hard time tracking down the problem. However, it got me wondering where these values are stored. I see one of them showing up in App.Config, though without a value. Is there a place I can see the others?

View 13 Replies

VS 2008 Windows Service

Feb 19, 2010

I've been google'ing around trying to look for examples of Windows Services using socket connections but everything has been C# or C++... I know this isn't 100% secure, but I want to do it as a practice: I want to create a Windows Service that listens on a specific port. When data is received I want to parse it as a command. For example, say I send "ring" to the IP/Port running the service it will play ring.wav.

[Code]...

View 1 Replies

VS 2008 Settings Write Permission On Windows 7?

Jan 22, 2011

when i tried to saving value to My.Settings its just work fine on windows xp. but when i ran on windows 7, VS2008 told me to change permission on My.Setting to writeable.

View 4 Replies

VS 2008 - Cannot Run Other Application In Windows Service

Apr 15, 2009

I created new windows service with timer inside it for scheduler purpose and it can run successfully but it can't run other application (ex: notepad) when the timer elapsed. I can see the process running in Task Manager but the notepad windows is not open. I used this code in timer_elapsed event.

AppLauncher oAppLauncher = new AppLauncher(@"C:WindowsRegedit.exe");
new Thread(new ThreadStart(oAppLauncher.StartProcess)).Start();
where applauncher is a Class
Class AppLauncher {
string myAppPath = string.Empty;
[Code] .....
When I build windows App I can see Notepad open using the same code.

View 4 Replies

VS 2008 - How To Start Windows Service

Dec 21, 2009

In Visual Studio when I try to start a windows service project it tells me I cant because I have to use "NET Start" and so forth. I remember in VS 2003 that when I pressed play it started the service and stop stopped it. Is there any way that when I press play or start for that windows service project I can have this same functionality. What I currently do is install them using installutil and I put a pre-processor command with System.Diagnostics.Debug.Launch() when I have a compilation variable defined and when I use the service manager it shows me the window to select the debugger. Still this method is somewhat cumbersome.

View 1 Replies

VS 2008 How Can I Print From My Windows Service?

Apr 25, 2011

I have a service that receives commands over the network and interacts with the database. At the time that I add a transaction I would like to print some sort of receipt ticket out to an epson tmt88iv. I would like the service to do this rather than have to maintain the printer on several tablets....Is this possible?

View 2 Replies

VS 2008 Installing A Windows Service In .Net

Apr 2, 2010

I have had some success making a windows service but I can�t seem to fix a simple issue

I can get the service to run through my code once, but I can�t get it to loop, well I can but then the service will not start correctly and just times out while the code is running.

How can I get the service to start and then loop, at the moment it just says starting service and the code is looping but the service wont start! Windows times it out after a few mins.

Public Class WwService
Dim sDate As Date
Dim con As New OleDb.OleDbConnection

[Code].....

View 4 Replies

VS 2008 Windows Service Deploying?

Oct 6, 2010

i have developed one windows service to support my front end application. I need to deploy only service project as MSI so client simply can install and no need to open services.msc for manual action.

I tired to use InstallUtil C:Myservice.exe and it is working but all client don't have VB.NET to find installUtil.

View 1 Replies

VS 2008 Windows Service Timeout

Jan 13, 2010

I have a Windows Service that is behaving strangely on Windows 2003 systems (works fine on XP, Win7). If the service is started manually within the OS, then everything is fine. However, if the system is rebooted (with the service set to Automatic startup), then an "At least one service or driver failed during system startup" dialog is generated once the boot completes. If I check the event log, there is an event 7022 with the following text:

[Code]...

View 1 Replies

.net 2.0 Windows Service Not Running On Server 2008?

Dec 4, 2009

I have a windows service written in .net framework 2.0. This service installs and runs perfectly fine on both XP and windows server 2003.We have a new 2008 box that we are migrating over to, so need to get this windows service up and running.When i try to 'start' the windows service on the 2008 machine, i get "Windows could not start the <service> service on local computer. Error 1053: The service did not respond to the start or control request in a timely fashion."I have searched everywhere looking for an answer, and all I could find was a fix attributed to .net framework 1.1 for this same error. That; however, is not applicable here, as the service was written in 2.0.

View 3 Replies

Host A Simple WCF As A Windows Service In 2008?

May 9, 2011

I have a (very) simple WCF written in VB which I can build and publish locally to IIS. Works great.

What I need to do is (somehow) deploy it to a different server which does not have IIS. It's supposed to be run as a windows service.

how to do this. All directions on MSDN seem to be for VS 2010 (we're using 2008).

View 1 Replies

VS 2008 .NET Windows Service : How To Make It Work

Jan 30, 2010

i have written hundreds of programs with vb.net 2008, but never a service before. I have a simple service written that basically just rights a entry in the eventlog to test. No coding/compiling issues. I run the "installutil.exe" and I get a error ever time. So I went back and added the "Add Installer". But I am sure of what else I need to do, as I get the same error. Please assist.

Error:

Installing assembly 'C:UsersDonaldDocumentsVisual Studio 2008ProjectsWindowsService1WindowsService1inReleasewindowsservice1.exe'.Affected parameters are: logtoconsole = assemblypath = C:UsersDonaldDocumentsVisual Studio 2008ProjectsWindowsService1WindowsService1inReleasewindowsservice1.exe logfile = C:UsersDonaldDocumentsVisual Studio

[code].....

View 3 Replies

VS 2008 Capturing Screenshots As A Windows Service?

Jul 29, 2009

Basically I have created a windows service using VB 2008 where I am trying to capture screenshots periodically. The timer is working fine and I have tested this. The purpose of the service is to monitor the desktop over night when the user is logged off, by capturing screenshots and saving them to file. This is so admin can be alarmed about security breaches etc.

[Code]...

View 3 Replies

VS 2008 Create Windows Service Using SHDocVw.dll In .net?

May 10, 2012

I have tried to create windows service using SHDocVw.dll in vb.net, but it generates error

The error is could not load SHDocVw.dll into windows service.

How to fix this issue? if you have any solution then, give me the links or urls.

View 1 Replies

VS 2008 Run Excel Macro From Windows Service?

Nov 15, 2011

I have an excel work book that contains a macro that search the outlook mail for some particular subject and creates a txt file. In my windows service vb.net program, I would like to open the excel call the macro and close the excel in the OnStart() event.

Public Class Service1
Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set things

[Code].....

View 14 Replies

VS 2008 Starting A Custom Windows Service?

Jul 5, 2010

I've created a Windows Service and installed it via InstallUtil so I can test it out.The installation goes seamlessly, but it will not start from some reason. When I attempt to start it, I get an "Access Denied" error and that's it.

I haven't been able to find any information via the normal channels.I first thought to give the service admin rights, but that didn't work either.

View 10 Replies

Windows 2003 Service With VB 2008 Not Working?

Aug 26, 2010

I am working on a VS .NET 2008 windows service for 2003, however it doesn�t appear to work correctly.I am basically reading a file from a networked computer and trying to display it�s content, the code is as follows:

Code:
Public Class LB_Analyzer
Private WithEvents Timer1 As New System.Timers.Timer
Protected Overrides Sub OnStart(ByVal args() As String)

[code]....

Now, everytime I run this service it logs the events inside the "GetMachineVol" function, but I never get to the ""Ticked at "" event log from the "main" sub, pretty much as if the service stopped working after trying to assign the value returned from "GetMachineVol" to the string "MachineVolBSFull". I tried using this code on a windows form and everything works fine, and since debugging a service is quite beyond my skills, I really do not know what could be wrong.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved