console-application

MSTest inside a Console Application

Hi I was trying to get some tests running inside a console application using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; // this doesn't work The error I'm getting is: The type or namespace name 'VisualStudio' does not exist in the namespace 'Mic...

ConsoleColor enum question

Hello, I know that console.foregroundColor takes a ConsoleColor enum as a parameter. What I do not get is why - I guess these are strings so when console.foreground recieve it as an argument, it will use some kind of switch based on these constants. Is it right? Or is there something I have missed? ...

Using a console application to host WCF endpoints that expose asp.net ProfileService, ProfileService and RoleService

Hi All, I've got an MVC web application that is used as an interface to a Console based app that exposes a bunch of ServiceHost/s using the net.pipe protocol. I would like to use the asp.net membership/role/profile provider to manage my users and their roles and profile information (Inside the Console Application). I've done this in q...

Changing the console size...

Simple problem in Delphi. I've created a console application and I need to change the height of the console window to 80 lines, if it's less than 80 lines. This need to be done from code and is actually conditional within the code. (I.e. when an error occurs, it increases the size of the console so the whole (huge) error report is visibl...

C# Console string builder with foregroundColor

Hi Im trying to add some color to this string for a simple Console app im creating. I would like each letter to be in a different color. const string WelcomeMessage = @" _______ _ _______ _______" + NewLine + @"|__ __(_) |__ __| |__ __| " + NewLine + ...

Prevent form from displaying in service / console

I am using a very old OCX in a project and have set every 'ShowMessages' type property to false that I could find. Yet, every-so-often, an error occurs deep within its bowels and a message box is popped up. I know this because I run the code in a console application and see the messages pop up. So my question is whether there is a way...

Console App Host ASPX Page?

In Framework 4.0 I have a little console app. I have a self-contained .aspx page (no codebehind) and would like to run the console app just to host this page. I searched around for tricks with System.ServiceModel.Web or System.Web.Services trying to find a way to do this. Can anyone help me get clue? Thanks. ...

Performance Tweaks for a Windows Console Application

I have a windows console application that queries a single database and creates flat files of the data for another external system. I will use Task Scheduler to execute a batch that will start this data export. Each query is retrieving a few hundred thousand rows of data (200k+). What is the best way to make my application scalable so th...

Building C# console app for multiple instances

I'm building a console application which imports data into databases. This is to run every hour depending on an input CSV file being present. The application also needs to be reused for other database imports on the same server, e.g. there could be up to 20 instances of the same .exe file with each instance having their own separate conf...