Peter Duniho said:
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 to
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).
So if I am going to use the Windows Forms Application, it starts like
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,
Tom