If that truely is the line that blows up (have you tried putting Console.WriteLine just before and after? the debugger smetimes reports the wrong line), then I would suspect that the ctor of Server is blowing up. do you have a full stack trace from the exception object?
Regards
Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog http://www.dotnetconsult.co.uk
Neil,
Here is a snippet:
using Ripple.Common;
using Ripple.Home.BusinessLayer;
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.EnterpriseServices;
namespace Ripple.Home.RemotaDataCollection
{
/// <summary>
/// Summary description for Collector.
/// </summary>
class Collector
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
//string x = ConfigurationSettings.AppSettings["Whatever"];
try
{
int ServerID = (int) ServerIDConstant.None;
int ServerTypeID = (int) ServerTypeIDConstant.None;
int Active = 0;
string WebServiceURL = string.Empty;
DataTable dtServer = new DataTable();
BusinessLayer.Server server = new BusinessLayer.Server(); <=== BREAKS
HERE.
/*
* Check for rows.
*/
dtServer = server.ListAll();
if (dtServer.Rows.Count > 0)
{
... END OF SNIPPET == == == == == ==
"NWeller" <ne*********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Mike Malter wrote: I am getting a error that should not be happening when I instantiate
an object from my business layer in a console application within my
solution.
I get an "object reference not set to an instance of an object." I
checked my references and the dll's are there. I have my namespace right and
I even get intellisense to work. I don't get this error anywhere else in my
solution when calling objects in different projects.
Does anyone have any idea what is going on? I have run out of things
to check.
Thanks.
Mike
Can you post the offending piece of code?
Neil
[microsoft.public.dotnet.languages.csharp]