TypeInitializationException

J

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.Instrumentation.DataConnectionFailedEvent"
threw an exception.
Stack: at
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent.Fire(String
connectionString) at
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataInstrumentationFacade.ConnectionFailed(String
connectionString) at
Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() at
Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DBCommandWrapper
command) at DMS_ASPX.Helper.News.LookupNewsByAccountType(Int32
intAccountType) at DMS_ASPX.form.main.fillNews()
 
J

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\InstallUtil.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\InstallUtil.exe
D:\Inetpub\wwwroot\MyWebApp1\bin\Microsoft.Practices.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=site:msdn.microsoft.com+Instal...

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top