If you're talking about a server-side console app, you don't even need to call AppTools.Init
. Here's the correct way:
- In your console project, create a class file called
Program.cs
. In the file, your class should look like this:
partial class Program { static partial void initGlobalLogic( ref SystemLogic globalLogic ) { globalLogic = new YourGlobalLogicClass(); } static partial void ewlMain( string[] args ) { DataAccessState.Current.PrimaryDatabaseConnection.ExecuteWithConnectionOpen( () => { // Your code goes here. // Skip the ExecuteWithConnectionOpen call if you don't need the database. } } }