473,408 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

TypeInitializationException

js
I got the following error and trace while trying to launch the
applicaiton. The application is installed on a Windows 2003 Server
running IIS6 with both Enterprise Library June 2005 and Jan 2006
installed. The application run perfectly on another Windows 2003
Server with exact configuration. This error seems to be database
related. This two installations hit the same database server.
Therefore, the connection string is identical. Does anyone know what
is going on? Thanks.

Type: System.TypeInitializationException
Message: The type initializer for
"Microsoft.Practices.EnterpriseLibrary.Data.Instru mentation.DataConnectionFailedEvent"
threw an exception.
Stack: at
Microsoft.Practices.EnterpriseLibrary.Data.Instrum entation.DataConnectionFailedEvent.Fire(String
connectionString) at
Microsoft.Practices.EnterpriseLibrary.Data.Instrum entation.DataInstrumentationFacade.ConnectionFaile d(String
connectionString) at
Microsoft.Practices.EnterpriseLibrary.Data.Databas e.OpenConnection() at
Microsoft.Practices.EnterpriseLibrary.Data.Databas e.ExecuteReader(DBCommandWrapper
command) at DMS_ASPX.Helper.News.LookupNewsByAccountType(Int32
intAccountType) at DMS_ASPX.form.main.fillNews()

Mar 30 '06 #1
1 1600
js
I finally found the solution. Thanks to Patrick.O.Ige post titled
"DAAB ExecuteReader method causes Exception". Just run the command in
a Command window
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Insta llUtil.exe against
Microsoft.Practices.EnterpriseLibrary.Data*.dll in my application
installation directory.

I am repeating his post here:

=================================================
Al try this:-
InstallUtil.exe against the Enterprise Library dll's in my project
\bin\
directory.

The InstallUtil.exe is located in the Windows/Microsoft.NET framework
directory. Usually, this is located in:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322
where the version is your latest version.
Open a DOS prompt, and navigate to the application's \bin\ directory,
for
example:
C:\Inetpub\wwwroot\MyWebApp1\bin\
Run the InstallUtil.exe against the Enterprise Library dll's in that
\bin\
directory. For example:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Insta llUtil.exe
D:\Inetpub\wwwroot\MyWebApp1\bin\Microsoft.Practic es.EnterpriseLibrary.Data*.dll

NOTE: It might be possible that the InstallUtil only needs to be run
against
one of the dll's. Afterall, the problem is that the app can't write to
the
registry, not that it can't find the dll's. But I don't know this for
sure,
because I ran it for all three of my Enterprise Library dll's right off
the
bat.

For more information on the InstallUtil.exe, obviously, MSDN has many
articles about it:
http://www.google.com/search?hl=en&q...oft.com+Instal...

Hope that would solve your problem
** This did the trick on some PC's
Patrick

Mar 31 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ethan | last post by:
I made a program that works fine as long as its on my machine, but as soon as i move it to a network drive it stops working. I'm still trying to run it on my machine just from a network drive and...
1
by: sys | last post by:
I made a smart client that I purposed to offer on a web server. But when I try to run it by dint of Internet Explorer, I get the System.TypeInitializationException in the IEExec.exe thread. My...
0
by: Sagaert Johan | last post by:
this code using System; using System.Net.Sockets; namespace ConsoleApplication1 { /// <summary> /// Summary description for Class1. /// </summary>
3
by: nick | last post by:
The program runs well on Local harddisk. But it always popup the exception if I run it on Netware mapping disk. After debugger say there is no source code on the exception. Also the following error...
1
by: Maqsood Ahmed | last post by:
Hello, We have encountered a System.TypeInitializationException in our product. This exception occurs while closing the application when application called excel.Quit(). excel is an...
0
by: user | last post by:
After starting a Windows Forms Application developed with VS 2005 Prof Beta 2, built in "Release" mode, I get "An unhandled exception of type 'System.TypeInitializationException' " When...
1
by: Dino M. Buljubasic | last post by:
Hi, I am receiving an exception each time I open one of my projects in VB.net. I do not have to run it, I just open the project and a Message box pops up with the message: ...
3
by: linaj | last post by:
Hi, I have singleton class in C#: class Logger { static Logger lInstance = new Logger(); private Logger() {}
1
by: nasambur | last post by:
Hi, i hav two classes as following; class1.cs ---------- namespace NAS { // fields // properties
0
by: =?Utf-8?B?TWFyY3VzIFNjaGFlZmVy?= | last post by:
Hi everybody, I'm working on my application for appr. 2 years and now suddenly I got an System.TypeInitializationException in one of my global modules. The error is thrown at the first call of a...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.