Hosting An Ongoing Process In IIS?

Mar 2, 2010

Is there a way to host an ongoing process in IIS? Let's say i'm writing an invoicing web site and every so often I need to send out scheduled invoices. This is really part of my invoicing app and I'd like it to be deployed as part of my invoicing app, by copying files to the web server. I don't want the deployment headaches or the awkward separation that would come with writing this as a Windows Service. Is there a way this can be done in IIS?

View 2 Replies


Similar Messages:

C# - Run A Daily Process In Shared Hosting Server?

Jan 2, 2011

I need to run a daily process at a given time. how to do it in ASP.NET/C#? web site is hosted in godaddy shared hosting server.

I've tried with timers but not working. I think this timers get reset with application pool recycling.

View 3 Replies

Hosting An In-process Document Database On Windows?

Jan 8, 2011

Are there any document-databases, similar to MongoDB, that run within an ASP.NET web application, and could be hosted on a server without any unique machine configuration?

I'm asking this because the hosting provider I'm currently with only support SQL Server 2008 as a database, but I'd like to run my website off a document database.

(Or am I better off going with a specialized database host, such as MongoHQ)?

View 1 Replies

Configuration :: Process.start (System.Diagnostics.Process) - Execute A Batch File

Sep 7, 2010

I've written a aspx.net(C#) page that after the user has done what they do on the page they hit a Submit button. The Submit button

1) takes the work the users was producing on the page and writes it to a file.
2) attempts to execute a batch file.

The call to the batch file is executed via:

protected void Execute123EDI()
{
try
{
string File = @"c:80sAdminSendV80s.bat";
lblCancelled.Text = lblCancelled.Text + File;
Process proc = new System.Diagnostics.Process();
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.LoadUserProfile = false;
proc.StartInfo.UserName = "administrator";
proc.StartInfo.RedirectStandardOutput = true;
System.Security.SecureString secPass = new System.Security.SecureString();
string paswd = "123abc";
for (int i = 0; i < paswd.Length; i++)
{
secPass.AppendChar(paswd[i]);
}
proc.StartInfo.Password = secPass;
proc.StartInfo.FileName = File;
proc.Start();
FileStream fs = new FileStream(@"c:80sAdminSendV80sOutput.log", FileMode.Append);
StreamWriter sw = new StreamWriter(fs);
sw.Write(proc.StandardOutput.ReadToEnd());
proc.WaitForExit();
sw.Close();
proc.Close();
}
catch(Exception ex)
{
lblDebug.Text = lblDebug.Text + ex.Message + "<br/>";
}

If I watch the processes tab in Task Manager on the web server I see "cmd.exe" under the context of 'administrator' but it just hangs. For test purposes c:SendV80s.bat: copy c: oot.ini c:zzz.txt

If I logon onto the webserver's console and execute SendV80s.bat it works and exits without issue. But when I execute the same batch file via the Submit button it gets stuck executing in Task Manager/Process. I believe this has something to do with the fact that cmd is not running in a full environment/desktop context. I just noticed this on the actual console of the webserver (not in my RDP console but console 0 instead)

A pop-up box stating: CMD.exe Application error The application failed to initialize properly (0xc0000142). Click OK to terminate the application. And when I click on the OK button my ASPX page's WaitForExit is satisfied and the continues processing normally.

View 2 Replies

Long Running HTTP Process - How To Put In Separate Process

Jul 21, 2010

I know that similar questions have been asked all over the place, but I'm having trouble finding one that relates directly to what I'm after.

I have a website where a user uploads a data file, then that file is transformed and imported into SQL. The file could be up to 50mb in size, and some times this process can take 30 minutes or sometimes even longer.

I realise I need to palm off the actual work to another process, and poll that process on the web page. I'm wondering what the best approach would be though? Being a web developer by trade, I'm finding all this new Windows Service stuff a bit confusing, and I just wanted somewhere to start.

So:

Can I do / should I being doing this with a windows service? if so, how?

Should I use WCF? If this runs under IIS, will I have problems with aspnet_wp.exe recycling and timing out my process?

clarifications

The data is imported into sql, there's no file distribution taking place.

If there is a failure, it absolutely MUST be reported to the user. The web page will poll every, lets say, 5 seconds, from the time the async task begins, to get the 'status' of the import. Once it's finished another response will tell the page to stop polling for status updates.

queries on final decision

ok, so as I thought, it seems that a windows service is the best idea. So as to HOW to get it to work, it seems the 'put the file there and wait for the service to pick it up' idea is the generally accepted way, is there a way I can start a process run by the service, without it having to constantly be checking a database table / folder? As I said earlier, I don't have any experience with Windows Services - I wondered if I put a public method in the service, can I call it somehow?

View 2 Replies

Execute A Process Remotely With System.Diagnostics.Process

Feb 26, 2010

I'm working on an ASP.net app I'm trying to execute a process remotely , using System.Diagnostics.Process class here's my code:

ProcessStartInfo startInfo = new ProcessStartInfo(@"C:TestCommand.exe");
startInfo.Domain = "myDomain";
startInfo.UserName = "MyUserName";
SecureString sec = new SecureString();
foreach (char item in "MyPassword")
{
sec.AppendChar(item);
}
sec.MakeReadOnly();
startInfo.Password = sec;
startInfo.UseShellExecute = false;
Process.Start(startInfo);

I keep receiving an exception with the message "Logon failure: unknown user name or bad password". Im absolutelly sure that i'm submiting my correct username/pwd

View 1 Replies

Web Forms :: The Process Cannot Access The File 'c: Empmy.pdf' Because It Is Being Used By Another Process?

Apr 3, 2010

I've developed a popup email .aspx used on our intranet based web app that is auto generated with .pdf's attached. I'm developing with VS 2008 ASP.Net 3.5 C# and System.Net.Mail.MailMessage. I can create and send the email with no issues. The problem is with any attempt to open or delete the attachments I get the above error. The .pdf's a copied with the following code:

FileStream fsr = new FileStream(inFilename, FileMode.Open, FileAccess.Read, FileShare.Read);
BinaryReader reader = new BinaryReader(fsr);
byte[] bytes = new byte[fsr.Length];
reader.Read(bytes, 0, bytes.Length);
FileStream fsw = new FileStream(outFileName, FileMode.Create, FileAccess.Write, FileShare.Write);
BinaryWriter writer = new BinaryWriter(fsw);
writer.Write(bytes, 0, bytes.Length);
// clean up
writer.Flush();
writer.Close();
writer = null;
fsw.Close();
fsw.Dispose();
fsw = null;
reader.Close();
reader = null;
fsr.Close();
fsr.Dispose();
fsr = null;
Later after sending the email I:
mailMessage.Dispose();
mailMessage = null;
foreach (string fileName in attachments)
{
if (File.Exists(fileName))
File.Delete(fileName);
}

The error occurs at: the File.Delete(fileName);

how I can delete or reopen these files after sending the email?

View 9 Replies

How To Recognize Whether The Process Is The IIS Worker Process From Within A .NET Code

Dec 25, 2010

Dear ladies and sirs.

I have a .NET infra code running both within the IIS worker process and within a desktop client app. How can the .NET code determine whether it is running within an IIS worker process?

I know that I could check the name of the process (w3wp.exe, for instance), but I would like a more robust approach. I wish to make a side note. This is not a production need. I need this information to enable certain scenarios useful during the development and testing phase. Specifically to ease the testing of secure vs non secure configurations.

View 3 Replies

C# - Tracking The Process Of A Singleton Process In A Web Application

Jan 26, 2010

When I hit the run button (in my Default.aspx), a process starts (this process contacts a webservice to get some files, etc). How do I: Ensure that only a single process is running at a time (i.e. if I refresh the browser, I don't want to start the process a second time)Track progress - there are 4 points of the process (at 25%, 50%, 75%, 100%) that I want to track, and when each part completes, I want to update the progress bar. I have a status object for the running process, but the question is how to update the progress bar automatically? Do I need to use threads to achieve the above two?

View 1 Replies

Web Forms :: Process Cannot Access The File It Is Being Used By Another Process?

Nov 6, 2010

My code is that I want to create a log file and log it upon a new user browsing the site. However, what i did was I put in a 6 second delay and then used another browser to access the page. And it threw an Exception saying it is being used by another process which is true. So how come I set it so that, if IT is being used by another process, WAIT and retry every 500 milliseconds until it becomes free/available?

here's the code:

protected void Page_Load(object sender, EventArgs e)
{if (!IsPostBack) // if this is the first time page loads, set k to 1
{ lognewuser();
}}

[Code]....

View 1 Replies

The Process Cannot Access The File 'C:inetpub' Because It Is Being Used By Another Process

Mar 28, 2011

I am having the text file which is used to track all the ip address which is available in the network and replace the content from"Reply from 172.29.116.3: bytes=32 time=1ms TTL=255" to 172.29.116.3.

For this task i am having 2 functions 1.runCMD() Function is used to create a file which ping all the ip address between 3 to 254 ("Reply from 172.29.116.3: bytes=32 time=1ms TTL=255").

2.Another function textFileReplace() which is used to replace the text from "Reply from 172.29.116.3: bytes=32 time=1ms TTL=255" to 172.29.116.3.

This process will continue every 30 minutes..

But i am having the error while accessing the function textFileReplace() as The process cannot access the file 'C:inetpub' because it is being used by another process.

View 4 Replies

SQL Server :: Error "Transaction (Process ID) Was Deadlocked On Lock Resources With Another Process And Has Been Chosen"

Jul 23, 2010

I have a stored procedure which fetches data after joining 8-9 tables and inserts that into a temp table. It was running fine till now, but now when the amount of data fetched have exceeded 20000, the SP is breaking. I have debugged the sp and found that this main query is failing after returning arround 15000-16000 records.

The error message says Transaction (Process ID) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. I know what is deadlock, but when i checked with SP_LOCK stored proc i only found that my process is running on database only. So how is this getting deadlocked when there are no other processes running simultaneously on server.

View 4 Replies

Process Can't Access File - Used By Another Process

Feb 10, 2010

When I delete all files from the directory path. then it will give me this error The process cannot access the file because it is being used by another process. How to solve this?

View 10 Replies

C# - The Process Cannot Access The File Because It Is Being Used By Another Process

May 12, 2010

I have an asp.net website and I allready did .Dispose() here is my code below;

try
{
MailMessage newMail = new MailMessage(MailFrom, MailTo,
MailSubject, MailMsg);
if (MailAttachment != "")
{
Attachment data = new Attachment(MailAttachment,
MediaTypeNames.Application.Octet);
newMail.Attachments.Add(data);
}
newMail.BodyEncoding = System.Text.Encoding.UTF8;
newMail.IsBodyHtml = true;
SmtpClient client = new SmtpClient("192.168.2.205");
client.Credentials = CredentialCache.DefaultNetworkCredentials;
client.Send(newMail);
newMail.Attachments.Dispose();
newMail.Dispose();
DeleteAttachment(MailAttachment);
lblSuccess.Text = "Başvurunuz alınmıştır teşekkürler.";
lblSuccess.Visible = true;
ClearForm();
}
catch (Exception ex)
{
lblSuccess.Text = ex.Message;
//lblSuccess.Text = "Bir sorun oluÅŸtu bir daha deneyiniz.";
lblSuccess.Visible = true;
}

But i' m getting the same error, it' s running fine in my localhost but in server i' m getting this error. How can i fix it?

View 2 Replies

C# - The Process Cannot Access The File Because It Is Being Used By Another Process?

Feb 8, 2010

I am getting binary data from a SQL Server database field and am creating a document locally in a directory my application has permissions. However I am still getting the error specified in the title. I have tried numerous suggestions posted on the web including those suggested in previous posts on Stackoverflow. I have also used ProcessExplorer > Find Handle to locate the lock and it returns nothing as if the file is not locked.

I am using the code below to save the file to the file system and I then try to copy this file to a new location later in the application process within another method. It is this copy method that takes the path of the newly created file that throws the exception.

The file itself is created with its content and i can open it through Windows Explorer without any problems.

Am I missing something completely obvious? Am I creating the file correctly from the database?

// Get file from DB
FileStream fs = new FileStream(
"C:myTempDirectorymyFile.doc", FileMode.OpenOrCreate, FileAccess.Write);
BinaryWriter br = new BinaryWriter(fs);
br.Write("BinaryDataFromDB");
fs.Flush();
fs.Close();
fs.Dispose();
// Copy file
File.Copy(sourceFileName, destinationFilename, true);

View 7 Replies

The Process Cannot Access The File Because It Is Being Used By Another Process?

Oct 5, 2010

Iam getting the above said error while Iam copying a file of relativelly Heavy say 130 MB.Below is the code which is giving the error.

System.IO.FileInfo FileInfo1 = new System.IO.FileInfo(filename1);
FileInfo1.CopyTo(strDestPath,true);

View 6 Replies

Process Cannot Access File Because It Is Being Used By Another Process

Feb 6, 2012

I am using a AsyncUpload(telerik), i am in a point where i am supposed to save the File to a certain Folder. First I check if the directory exist

Code:
Dim baseDire As String = Server.MapPath("~/MyFILES/")
If IO.Directory.Exists(baseDire & Request("Req_ID").ToString()) = False Then
IO.Directory.CreateDirectory(baseDire & Request("Req_ID").ToString())
End If

Because i am doing multiple Upload , i will have to loop through the items of the Upload control and save to a folder.

Code:
For Each file As UploadedFile In UploadPropDoc.UploadedFiles
Dim bytes(file.ContentLength - 1) As Byte
file.InputStream.Read(bytes, 0, file.ContentLength)
'Save the File to the disk
file.SaveAs(baseDire + file.GetName())
Next

Now when ever i debug this , when it comes to this line

Code:
file.SaveAs(baseDire + file.GetName())

I get an Error

The process cannot access the file because it is being used by another process.

I have removed the Readonly in the Folder that it supposed to write to and gave everyone permission , but still the error persist.

View 1 Replies

While Trying To Download A File : The Process Cannot Access The File Because It Is Being Used By Another Process

Oct 17, 2010

I am trying to download a file from the server but i am getting this error:

The process cannot access xxxx the file because it is being used by another process

This is my CODE:
string fileName="DownLoadFiles";
string filePath = hid_filepath.Value;
FileInfo file = new FileInfo(filePath);
System.Net.WebClient wc = new System.Net.WebClient();
wc.DownloadFile(new Uri(fileName, filePath);

Foe ur Information:the file is not opened or not used.

View 1 Replies

WCF Hosting And Samples

Oct 13, 2010

Wcf Hosting Please Give the Solution.and Give samples .And AlsoConsume Wcf in Silverlight application

View 4 Replies

Is .NET Hosting Expensive Than Php

Apr 4, 2011

I'm a C# programmer and I love the language. I think it's the best thing since sliced bread. Recently I have become real interested in creating a website that offers jobs and allows companies to post jobs for people to navigate through.

This is going to be a nationwide site only, no international connections.

I'm somewhat familiar with ASP.NET (I've used it before for a much smaller pet project) but I wouldn't say I'm more than a

Newb - Journeyman - Novice -
Experienced - Expert

I have absolutely zero experience hosting a website or even registering a domain. I'm familiar with HTML and making applications in XAML for WPF has given me a much easier time understand things that laid out in markup.

Is ASP.NET hosting expensive? Is PHP cheaper? Should I use ASP.NET or PHP?

View 7 Replies

.net - Hosting Application From WCF?

Sep 27, 2010

Is it possible to host an ASP.net (MVC in particular, but I'm not sure if that's important) application from a self-hosted WCF service? I don't want to get into IIS, and I'd like to avoid something like Cassini if possible.

View 2 Replies

Configuration :: Hosting On Own Web Server?

Aug 10, 2010

I hope, the post is posted where it should be posted.I want to host my website on my IIS webserver so that I can access it on Internet. Could someone provide links for it.

View 13 Replies

Looking For Hosting Provider That Allows To Run On The Same IIS Server?

Nov 30, 2010

One thing that has always deterred me about using ASP.NET is the cost for hosting was generally is a bit higher then the LAMP environment equivalent (and also a small little thing called WebForms). Now that I can getting back into C# programming, I think I am going to take another look at ASP.NET. ASP.NET MVC seems to have grown since I last look at it (version 1 was still in beta) and it seems like ASP.NET MVC might be the best of both worlds of ASP.NET and PHP. That being I can use C# as my language and template system (like I can with PHP) and not have to deal with the ultra super fantastically craptastical WebForms (can you tell I don't like them? ).

Now I need to find a good hosting provider and have a few requirements to be able to successfully replace my current LAMP hosting. I am going to want a hosting provider that allows me to have both PHP and ASP.NET running on the same IIS server so that I can host both type of projects from my web server (assume it is possible to run both PHP and ASP.NET on the same IIS server at the same time). I am also going to want to use MySQL instead of MSSQL. I am also going to want to be able to install subversion and/or git to host my own repositories. Figuring with all these requirements a shared provider won't cut it and I am probably going to need a virtual dedicated provider and if so I assume that would come with access for remote desktop into the server to allow to be manage it, right? I also want to make sure that it is easy to upgrade (or downgrade) the plan so that I can start off with the cheapest option and upgrade easily if my usage demands it.

Can anyone recommend a reliable and affordable windows server hosting provider that meets these requirements?

View 2 Replies

VS 2010 4.0 Free Web Hosting?

Aug 6, 2010

Do you guys know any free web hosting site for asp.net 4.0? Sorry for posting it here, i dont know if this is the right place to ask for it.

View 3 Replies

ObjectDataSource Cannot See Its Own Hosting Class

Aug 3, 2010

I have a gridview I want to populate with an ObjectDataSource.Problem is, when I use the wizard, I cannot find the page the ObjectDataSource belongs to, in the business object list. I can see the classes in the App_Data and App_Code, but I want to use a method in this current page´s codebehind class.

View 5 Replies







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