Page 1 of 1

Argumentexception

Posted: Tue 21 Jun 2011 12:39
by balob73
Hi!

I have made a very short test program and this program work in my developer computer which run windows 7. But when I move the program to a Windows XP computer i get the following error:
Unhandled Exception: System.ArgumentException: The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.
I have installed the dotconnect for sqlite standard (the free version) on the xp computer.

My computerprogram is very simple:

Code: Select all

    
class Program
    {
        static void Main(string[] args)
        {
            MainEntities db = new MainEntities();

            Sale saleperson = (from s in db.Sales where s.Id == 1 select s).First();
            Console.WriteLine(saleperson.Seller.ToString());
            Console.ReadKey();
        }
    }
My app.config file:

Code: Select all



    
        
    
  
    
      
      
    
  

I hope anyone can help me with this.

Kind regards,
Ronny

Posted: Wed 22 Jun 2011 09:03
by balob73
After some debugging I have found that the program run fine when startet within VS2010, but will not start when I run it from a dos command promt.

I get this error in both XP and Win7 computers.

When reading the documentation I see that I have to add something about DbProviderFactories and I think this can be the reason for why I get an error. I am not sure where to add this code (I do prefer to not have to add this in macine.config).

I hope someone can help me with this. :-)

Posted: Wed 22 Jun 2011 13:47
by balob73
I have managed to solve my problem. It was the DbProviderFactories which was not correctly implemented. :idea: