Print Page | Close Window

TypeInitializationException

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=467
Printed Date: 11-Jun-2026 at 7:32pm


Topic: TypeInitializationException
Posted By: Warren
Subject: TypeInitializationException
Date Posted: 03-Oct-2007 at 5:13pm
I'm attempting my first deployment - a C# Console app to reside on the same computer as the database server. It works fine on my development system, connected to a copy of the database residing on the same system. The development system connects to database server (local), and that's what's in IdeaBlade.ibconfig. It doesn't look to me like anything in the config file would need to be changed.
 
So I publish and install on the server using Click Once, and the program starts up fine when I try to run it. However, soon after, as I try to use the PersistenceManager to fetch the first object from the database, it blows up with a TypeInitializationException.
 
Am I missing something obvious? (BTW, this is with version 3.5.3.1)
 
Thanks for any help you can give.



Replies:
Posted By: Linguinut
Date Posted: 03-Oct-2007 at 5:58pm
Hey Warren,
 
Is there a named instance involved?  If so, you may have to specify it in the ibconfig file.
 
Also, I run a database connection check when the app launches.  That just helps me tackle those pesky connection issues up front.
 
Bill


Posted By: davidklitzke
Date Posted: 04-Oct-2007 at 8:14am
Your application runs fine on your development system because the required IdeaBlade assemblies are already installed in the Global Assembly Cache (GAC).  When you use Click-Once, you must make sure to include these same required assemblies.
 
The one assembly that is most often forgotten is IdeaBlade.Persistence.Server.dll.  See if this assembly exists in your deployment directory.  If not, copy this assembly, and retry running your application.


Posted By: Warren
Date Posted: 04-Oct-2007 at 9:11am
Aha - that was it.
The reason that it's often forgotten is that you do the Publish setup in Visual Studio, that dll doesn't appear in the list.
 
Thanks for the help.



Print Page | Close Window