VS 2010 - Multiple FileSystem Watchers In Windows Service
Oct 14, 2011
Now I want to create several filesystemwatchers in my Windows Service and have them monitor different folders but do basically the same thing when files are created. That is, they will be calling the same routines. So my code so far is this:
Code:
// 10/14 - Create N fsw's as specified in the config file.
int nbrFsw = Convert.ToInt32(ConfigSettings.ReadSetting("NumberOfWatchers"));
List<FileSystemWatcher> listOfFsw = new List<FileSystemWatcher>();
for (int i = 0; i < nbrFsw; ++i) {
FileSystemWatcher fsw = new FileSystemWatcher();
[Code] ....
Is there a potential problem that all fsw's that get created are calling the same "on created" event handler? Or will this work nicely?
My requirement is this. I need to watch Output folders and when pdf files are created here I upload the files to a server. These Output folders are in web app deployments. I need to do this function for more than one deployment on the same machine, thus my need for more than one fsw.
This will ultimately be a web service but I am trying this out in a windows program, hence the presence of lblMessages which is on a windows form...
View 10 Replies
Similar Messages:
Nov 29, 2012
I am writing a web service for a customer. I tested it locally fine using a consumer, but he is having an issue calling it from his jquery, so he asked for logging.I figured I would use the Windows Event Log for this purpose. after I added the event log and was testing it locally via the consumer, I had an error saying The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security. So what I did to solve that was restart Visual Studio with administrator privelege so the event logs could be searched. And I am writing to my event log locally with no other issues.
My question is, when my customer intalls this new version of my web service, will it be able/unable to search the logs and if unable, how can it be given admin privelege so it is able, or again is that a bad idea?
View 1 Replies
Nov 17, 2011
I have a deadline to install my windows service NOW. I developed it in VS2010 and chose the .NET 4.0 framework. The server where I am installing it, which is a server that hosts our live web sites, does not have .NET 4.0 installed. So I have to change the framework to 3.5. I have this error now when I try to build:
Error13Type System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a in the data at line 120, position 4 cannot be located. Line 122, position
5.C:DevprojectsDocFtpToVendorDocumentFtpProjectInstaller.resx1225DocumentFtpIt is in ProjectInstaller.resx and also Service1.resx. Is it because the version=4.0.0.0, and if so how do I change that? And if not, what is the cause?
View 9 Replies
Mar 13, 2011
We've got an enterprise ASP.NET/VB.NET application that has multiple clients running on different versions (websites) of the product code.
I am trying to make a windows service that runs on our server to execute long running tasks. This service needs to run the correct version of code for each client and I had originally thought about calling a WCF Service that would be deployed as part of the web version.
The problem is that our IIS pools recycle each night and this opens up the possibility of a job getting aborted. A job that went over 24hrs would never get an opportunity to finish.
Our server is running Windows Server 2003, IIS 6.0, .NET Framework 3.5, SQL Server 2005.
Is there a way to load assemblies dynamically to use without having to restart the service?
Edit: I ended up using System.AddIn detailed in this step by step example
View 2 Replies
Dec 3, 2010
I am developping the ERP Web Application. My solution structure is as given below. Main Web Application - Having reference to All Module Web Application. Common Web Application - Has Master Page, User Control, Login page, Defualt Error and etc Module Web Application - Having Module wise Aspx and code behind. It refer Common Web Application to reduce redundacy. In this Context we are facing the following problem.
1) while running web application in the debug mode it gives error as 'the target assembly contains no service types. You may need to adjust the Code Access Security policy of this assembly'
2) Could not Debug both Module and Common Web Application.
3) In Design Time both Master or user control not renders in refered Aspx Page.
4) While I debug in visual studio 2010, it gets restart after some time.
View 1 Replies
May 18, 2010
I have a clean installation of Windows 7 with VS2010 RTM and am trying to get the ASP.NET Development Server to work. When I run the project, the WebDev server starts and shows that it's listening on port x on localhost. I've tried:telnet to the port. The port is not listening. running netstat -o shows that the WebDev server is in fact not listening on any port. manually changing the WebDev port to a different port and restarted VS without effect. I have Windows Firewall turned off entirely and am not running any other firewall software either.
View 1 Replies
Dec 13, 2010
Iam using ftp client wrapper class for accessing ftp.
iam able to download files from ftp when used in windows application
when i try to use the same code with windows service i get an error
the error is
"The underlying connection was closed: An unexpected error occurred on a receive. "
this error i get on directory listing
the stack trace is:
[Code]....
Note:
FTP is getting connected throgh service
FTP is getting connected throug FileZilla, internet explorer
soruce code:
[Code]....
View 5 Replies
Jul 28, 2010
When i create a Windows Service for getting information from a Web Application(ASP.NET c#) for scheduling some task in the client machine.
To consume WCF from the web application. I added WCF reference to Window Service project as a service reference, everything seems fine. It updated app.config file, added service reference etc.
it was not working.
[Code]....
View 1 Replies
May 24, 2012
I developed a web service in VS2010 on my local machine, wrote a consumer of it also locally, and that all works.
I copied the dll and the asmx file to our server, and I am getting an error when I try to invoke it from a browser (also still on the server machine) to make sure it correctly exposes its web methods, but it is not, it is saying "Could not create type 'Service'". That error comes from this line:
Line 1: <%@ WebService Language="C#" CodeBehind="~/App_Code/WarrantyDuplicate.cs" Class="Service" %>
There other web services in the same folder on the server that all work fine so I don't believe it's an IIS setup thing.
This is my first web service in C# and when I created it in VS I did think it odd that the code behind file went into App_Code (as you can see from the line in the asmx file) and is just named dot-cs rather than asmx-dot-cs. But since it worked fine locally, I wasn't sure that mattered.
View 2 Replies
Aug 31, 2010
I've put together some code that processes XML files as they're uploaded to the server using the FileSystemWatcher for one of my clients. The XML is uploaded every hour, and the FSW watches a set directory for new files. All is well and works fine in my development environment but I'm using my clients hosting provider (www.webhostforasp.net) and when uploading a new XML file it appears that nothing is happening? It is possible that the hosting provider doesn't allow watchers or calls from the Global.asax?
What would be the best way to find out what's going on there, considering that without running the site in debug mode, I've got no way of knowing what's going on with the Global.asax or the FSW?
View 4 Replies
Sep 22, 2010
I have a web application - .net 4. The client is having a requirement that he want to send email to his users on a regular basis about his new courses etc.
The webapplication created will hosted on a "Shared hosting environment" with no excess to windows services - file system other than the web root folder through FTP.
Due to shared hosting i cannot create a windows service for him which will check the database - if there are any scheduled mail to send every 5 min.
So my question is - Is there anyway i can run a wcf web service or any other web based service or page or handler which can keep running and automatically checks the database for any new scheduled mails - if yes start sending it automatically in an different thread.
View 2 Replies
Feb 22, 2010
installing visual studio 2010 pro RC in windows Xp SP3 and getting a message prompt : invalid windows installer package contact vendorlog file says
Error Message:
[02/22/10,17:09:07] Microsoft Application Error Reporting: [2] CMsiComponent::Install() expects the setup file for Microsoft Application Error Reporting, but the file failed verification.
[02/22/10,17:09:07] setup.exe: [2] ISetupComponent::Pre/Post/Install() failed in ISetupManager::InternalInstallManager() with HRESULT -2147467259.
[02/22/10,17:09:08] VS70pgui: [2] DepCheck indicates Microsoft Application Error Reporting is not installed.
View 5 Replies
Jan 14, 2011
I have recently purchased a new PC with Windows 7 Pro. My previous PC had Windows XP Media Edition (don't laugh it worked ) Which is exactly my point my app in VS2010 that consumed an intranet web service worked fine on the XP machine buut when I moved it over to the Win7 machine I keep getting an error from the web service that simply says "Unknown". I am trying to find out from the web service creator what that means but my point is that I do not understand why changing PC's and OS's should make a difference. This is not the only software though. I have 3 separate ASP.NET softwares that consume the web service and none of them that were (and still do) working in the XP function in the Win7. I have disabled my firewall to see if it was blocking for some reason..
View 11 Replies
Mar 3, 2011
Suppose there is one folder "D:Main" which can contain any word file. On adding any file/files to the folder I need to parse the file and based on some keywords I need to transfer the file to some other sub folders as well as some entry to the database also.
I know something about FileSystemWatcher. If there would have been a button like "Check and Move" then I know that on the button click event I can do something but how to do it automatically. I mean if I add file to the folder manually also it should do the same(files may be uploaded via web as well as manually).I am currently working in web application with asp.net and c# and I have a little knowledge about windows application.
View 2 Replies
Mar 11, 2011
Can I install Microsoft Visual Studio 2010 Service Pack 1 in Microsoft Visual Web Developer 2010 Express?
View 1 Replies
Nov 5, 2010
using vb.net 2005.
what is the best and easiest way to test a windows service while developing it?
View 5 Replies
Dec 11, 2010
My question about I created a web site as a file system if I need to publish it what is the rules I follow.
View 2 Replies
Aug 26, 2010
Although it may not seem like that but there is a little questions about this subject.I am not asking if I should use DB or filesystem, the file system it is, but I am asking what is the best way of organizing pictures in file system that will be used with asp.net application? I am talking about tens or even hundreds of thousands of picture.
To elaborate a question a bit.
Where should repository be located, create another VD in IIS or in application VD, or somewhere outside IIS?
How to organize file patsh, put them all in one folder or create subfolders. If so how to name all those folders?How to handle multiple sizes of the same image? where to locate them?How to sync folders and images with database?What else crosses your mind, and you think it's important..
I've done something myself allready, but I am asking if someone had some experience with this. Maybe it could be done better yours way.
I put things like this
I stored pictures in IIS folder, because storing them outside of iis make them unable to use in web, because of paths. You cannot use file path in web, it must be virtual file path.
http://images/1.jpg istead of C:images1.jpg
in the root I had subfolder for each picture size
root-
+400x300
+600x400
+1024x768
Named images by id from database. If the ImageID from database is 45678909, the name of picture is 45678909.jpg an it's location is
VDimages400x30045678945678909.jpg
VDimages600x40045678945678909.jpg
I sliced the picture name two by two, and create subfolders. the point was not to have more than 100 files in folder. Was this good idea or stupid one? How would you organize this? For person, this organization with tons of folder is not easy to use.
Name of the image with its relative path I saved in database table with description and time of insert etc. path: 45678945678909.jpg
View 2 Replies
Sep 20, 2010
Does Session Time - out is applicable ing Windows authentication?If so, in what event can i capture this?
View 6 Replies
Feb 26, 2011
i am installing on windows 7 visual studio 2010 but still continuing about 2 hours
View 1 Replies
May 2, 2010
We have two servers, both are containing a local application connecting to local web service, applications and services are identical on both servers. One of the servers work just fine, The other one is just dead, I have impression the the security configuration are different on those servers. What prevents an application X from connecting a web-service, given that another application y on the same server can connect to it. and X is a windows service. What I should check, what is chances?
View 2 Replies
Dec 28, 2010
I need to read the data from the COM port in a web application, so I have written a Windows Service for reading data from serial ports. Now I need to access that data in a web application. Can anyone tell me how to access it? Is using threads the best way to do this or not? What other possible ways are there?
View 3 Replies
Sep 10, 2010
I wanna embed the windows service in the web application. I have seen few posts in the web. where they generate separate exe for the windows service and use it as an installable.
The same process i tried doing it but it threw an OS error in my server which is windows 2000 and didnt supported the executable.
However the website of mine runs fine in the same server. Thus i was thinking if i cd embed the same code in the web application.
Also, in my case the website of mine takes job for simulation. These jobs are taken for simulation execution and nearly takes 12hrs for completion and if they are not completed within twelve hours then they are supplied extra twelve hours to complete the simulation jobs.
The simulation executables are a series of executable and bat files.
The results of the simulation gets updated in the tables of MySql and hence are displayed to the user.
View 2 Replies
Jan 20, 2011
I need a windows service. This service will start when userId insert on myDatabase.And after I want to handle this userId send
to my web service.If webservice return true I insert this userId another table on mydatabase. How can I write this?
View 5 Replies
Feb 14, 2010
I have built a web page that does a complex processing, and I realized recently that I need to convert it to a windows service running at the background and keeping the web page for monitoring and initiating the service.
The service will process some files, and provides information messages to the user.
I'm not sure how to implement the link between the windows service and the web site, but i was trying to avoid using MSMQ to connect both application together.
View 1 Replies