Re: Creating a Project no form
- From: Jesse Houwing <jesse.houwing@xxxxxxxxxxxxxxxx>
- Date: Wed, 09 Sep 2009 02:08:06 +0200
* tshad wrote, On 8-9-2009 23:08:
What if I created a Service App. Could I run that as either a Windows
Service or an executable run by the Scheduler.
It might be nice to build it that so that if later the customer wants to run
the executable the service would be already set up with a few changes.
If you put all the real functionality in a Class Library, you can reference this library from both a console app project and a windows service project. That gives you the flexibility of both types of applications and maximum reuse of your code.
While you're going to be loading a bunch of data into a Database (SQL Server?) you might also want to consider using Sql Server Integration Services combined with a Sql Agent Job. It's purposely built for DLT jobs like the one you're programming.
JEsse
Thanks,
Tom
"tshad"<toms@xxxxxxxx> wrote in message
news:%23B3qA5LMKHA.3588@xxxxxxxxxxxxxxxxxxxxxxx
"Peter Duniho"<no.peted.spam@xxxxxxxxxxxxxxxxxx> wrote in message
news:op.uzyb0qmsvmc1hu@xxxxxxxxxxxxxxxxxxxx
On Tue, 08 Sep 2009 11:27:39 -0700, tshad<toms@xxxxxxxx> wrote:
If I am using ASP.Net 2008, and I want to create an executable which
will
have no user interface and will only be run from the scheduler, what
type of
project do I create.
Can I create an ASP.Net a Windows Forms Application even if not using
the
form?
I don't understand the question. ASP.NET and Windows Forms are two
completely different kinds of projects, for completely different
purposes. And a program with no UI would not use either type of project,
because both ASP.NET and Windows Forms are defined (at least in part) by
how the UI is built.
You're right. What I should have said was .Net Windows Forms. I am also
going to have a web page but not for making changes to the tables, but
this app is only going to run once, read a bunch of csv files and update
tables based on what is in the files.
Depending on whether you want any output or not, you probably want toSo if I am going to use the Windows Forms Application, it starts like
build a console application, or a Windows Forms application in which
you've removed the default main form and associated calls in the
Program.Main() method (i.e. delete System.Windows.Forms from the project
references, and then delete any code that winds up with a compiler error
after you've removed that assembly reference).
this:
********************************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace TestApp
{
static class Program
{
///<summary>
/// The main entry point for the application.
///</summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
*********************************************************************
I then take out the:
System.Windows.Forms From the references
using System.Windows.Forms; From program.cs
forms.cs delete from the project.
I then get errors on "Application",
Error 1 The name 'Application' does not exist in the current context
C:\Documents and Settings\tscheiderich\My Documents\Visual Studio
2008\Projects\TestApp\TestApp\Program.cs 15 13 TestApp
So I take out the 3 lines that start out with Application and add a call
to my starting method
Is that right?
What would be the difference between this and a console app?
Thanks,
TomPete
--
--
Jesse Houwing
jesse.houwing at sogeti.nl
.
- References:
- Creating a Project no form
- From: tshad
- Re: Creating a Project no form
- From: Peter Duniho
- Re: Creating a Project no form
- From: tshad
- Re: Creating a Project no form
- From: tshad
- Creating a Project no form
- Prev by Date: Re: Which windows OS has CLR
- Next by Date: Re: Installation of a C# .Net 2003 Application
- Previous by thread: Re: Creating a Project no form
- Next by thread: Re: Creating a Project no form
- Index(es):
Relevant Pages
|