473,406 Members | 2,352 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,406 software developers and data experts.

DAAB ExecuteReader method causes Exception

Hi all,

I'm trying to deploy an ASP.NET (1.1) app to our production webserver, but
having problems with the DAAB (from Ent Lib June 2005).
As you might guess, it works just fine and dandy on my dev PC (VS2003).

The error I'm getting on the production server is:
The type initializer for
"Microsoft.Practices.EnterpriseLibrary.Data.Instru mentation.DataConnectionFailedEvent"
threw an exception
Background info:
Using our own webserver, so I have direct folder access.
The application is for use on our Extranet and uses SSL for all comms.
Users access control is via Forms Auth (tried and tested methods used in all
our extranet apps).
I have used normal xcopy (cut & paste) deployment for the project folders
and aspx, dataconfiguration and dll files, then set up the virtual directory
on IIS, and enabled the required use of SSL on the new virtual directory.
I have other apps using the direct ADO.NET data methods, which all work
fine, so the folder structure and setup is not something I'm concerned
about.
I've converted one page of my new app to use the direct methods and these
work OK, so I believe the virtual directory config and SQL permissions can
be eliminated as a problem and it narrows the problem directly to the DAAB
methods.

So the folder structure is:
<myWebsite>
+--<myAppVDir>
+--Bin
+--images

With the files in my app's V-Dir being:
all the aspx files, globa.asax, styles.css
dataconfiguration.config
web.config

Content of /bin:
My project's dll
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Configuratio n.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll

I have set a project-level Imports for the
Microsoft.Practices.EnterpriseLibrary.Data
The production versions of web.config and dataconfiguration.config files
have been modified to use the production instance of the SQL dbo.

I've narrowed down my problem specifically to the db.ExecuteReader method
used to load the IDataReader.

In Page_Load, call is made to method for retrieving users email address:

Private Sub GetStaffEmail()
Dim db As Database = DatabaseFactory.CreateDatabase
Dim cmd As DBCommandWrapper =
db.GetStoredProcCommandWrapper("usp_OnLine_EmailAd dr_for_Staff_SELECT")
Dim dataReader As IDataReader
'Add the required parameter:
cmd.AddInParameter("@ExtranetUSID", DbType.Int32, Me.intUSID)
Try
'Execute command and retrieve data:
dataReader = db.ExecuteReader(cmd) ' <--- Fails. Triggers exception
....
Catch
....
Finally
'Dispose of dataReader
....
End Try
End Sub

I have not installed or run any process specifically for the EntLib on the
server, other than copy the three DLL's as outlined above.
Should I run/install the EntLib MSI and then run the "Install Services"
batch file?
Being cautious, I avoid installing anything I don't have to on the
production server.

Is there anything else I should be aware of to implement the EntLib DAAB?

Thanks for any pointers.

Al
Feb 17 '06 #1
7 1643
Alec, I would say yes...install and run the services...DAAB has some built
in dependencies to other components of the Enterprise library. Good luck,

-Jose
"Alec MacLean" <al**********@NO-SPAM-copeohs.com> wrote in message
news:Ox**************@TK2MSFTNGP09.phx.gbl...
Hi all,

I'm trying to deploy an ASP.NET (1.1) app to our production webserver, but
having problems with the DAAB (from Ent Lib June 2005).
As you might guess, it works just fine and dandy on my dev PC (VS2003).

The error I'm getting on the production server is:
The type initializer for
"Microsoft.Practices.EnterpriseLibrary.Data.Instru mentation.DataConnectionFailedEvent"
threw an exception
Background info:
Using our own webserver, so I have direct folder access.
The application is for use on our Extranet and uses SSL for all comms.
Users access control is via Forms Auth (tried and tested methods used in
all our extranet apps).
I have used normal xcopy (cut & paste) deployment for the project folders
and aspx, dataconfiguration and dll files, then set up the virtual
directory on IIS, and enabled the required use of SSL on the new virtual
directory.
I have other apps using the direct ADO.NET data methods, which all work
fine, so the folder structure and setup is not something I'm concerned
about.
I've converted one page of my new app to use the direct methods and these
work OK, so I believe the virtual directory config and SQL permissions can
be eliminated as a problem and it narrows the problem directly to the DAAB
methods.

So the folder structure is:
<myWebsite>
+--<myAppVDir>
+--Bin
+--images

With the files in my app's V-Dir being:
all the aspx files, globa.asax, styles.css
dataconfiguration.config
web.config

Content of /bin:
My project's dll
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Configuratio n.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll

I have set a project-level Imports for the
Microsoft.Practices.EnterpriseLibrary.Data
The production versions of web.config and dataconfiguration.config files
have been modified to use the production instance of the SQL dbo.

I've narrowed down my problem specifically to the db.ExecuteReader method
used to load the IDataReader.

In Page_Load, call is made to method for retrieving users email address:

Private Sub GetStaffEmail()
Dim db As Database = DatabaseFactory.CreateDatabase
Dim cmd As DBCommandWrapper =
db.GetStoredProcCommandWrapper("usp_OnLine_EmailAd dr_for_Staff_SELECT")
Dim dataReader As IDataReader
'Add the required parameter:
cmd.AddInParameter("@ExtranetUSID", DbType.Int32, Me.intUSID)
Try
'Execute command and retrieve data:
dataReader = db.ExecuteReader(cmd) ' <--- Fails. Triggers exception
...
Catch
...
Finally
'Dispose of dataReader
...
End Try
End Sub

I have not installed or run any process specifically for the EntLib on the
server, other than copy the three DLL's as outlined above.
Should I run/install the EntLib MSI and then run the "Install Services"
batch file?
Being cautious, I avoid installing anything I don't have to on the
production server.

Is there anything else I should be aware of to implement the EntLib DAAB?

Thanks for any pointers.

Al

Feb 17 '06 #2
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...nstallUtil.exe
Hope that would solve your problem
** This did the trick on some PC's
Patrick
"Jose Rodriguez" <jo*********@yahoo.com> wrote in message
news:ej**************@TK2MSFTNGP09.phx.gbl...
Alec, I would say yes...install and run the services...DAAB has some built
in dependencies to other components of the Enterprise library. Good luck,

-Jose
"Alec MacLean" <al**********@NO-SPAM-copeohs.com> wrote in message
news:Ox**************@TK2MSFTNGP09.phx.gbl...
Hi all,

I'm trying to deploy an ASP.NET (1.1) app to our production webserver,
but having problems with the DAAB (from Ent Lib June 2005).
As you might guess, it works just fine and dandy on my dev PC (VS2003).

The error I'm getting on the production server is:
The type initializer for
"Microsoft.Practices.EnterpriseLibrary.Data.Instru mentation.DataConnectionFailedEvent"
threw an exception
Background info:
Using our own webserver, so I have direct folder access.
The application is for use on our Extranet and uses SSL for all comms.
Users access control is via Forms Auth (tried and tested methods used in
all our extranet apps).
I have used normal xcopy (cut & paste) deployment for the project folders
and aspx, dataconfiguration and dll files, then set up the virtual
directory on IIS, and enabled the required use of SSL on the new virtual
directory.
I have other apps using the direct ADO.NET data methods, which all work
fine, so the folder structure and setup is not something I'm concerned
about.
I've converted one page of my new app to use the direct methods and these
work OK, so I believe the virtual directory config and SQL permissions
can be eliminated as a problem and it narrows the problem directly to the
DAAB methods.

So the folder structure is:
<myWebsite>
+--<myAppVDir>
+--Bin
+--images

With the files in my app's V-Dir being:
all the aspx files, globa.asax, styles.css
dataconfiguration.config
web.config

Content of /bin:
My project's dll
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Configuratio n.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll

I have set a project-level Imports for the
Microsoft.Practices.EnterpriseLibrary.Data
The production versions of web.config and dataconfiguration.config files
have been modified to use the production instance of the SQL dbo.

I've narrowed down my problem specifically to the db.ExecuteReader method
used to load the IDataReader.

In Page_Load, call is made to method for retrieving users email address:

Private Sub GetStaffEmail()
Dim db As Database = DatabaseFactory.CreateDatabase
Dim cmd As DBCommandWrapper =
db.GetStoredProcCommandWrapper("usp_OnLine_EmailAd dr_for_Staff_SELECT")
Dim dataReader As IDataReader
'Add the required parameter:
cmd.AddInParameter("@ExtranetUSID", DbType.Int32, Me.intUSID)
Try
'Execute command and retrieve data:
dataReader = db.ExecuteReader(cmd) ' <--- Fails. Triggers exception
...
Catch
...
Finally
'Dispose of dataReader
...
End Try
End Sub

I have not installed or run any process specifically for the EntLib on
the server, other than copy the three DLL's as outlined above.
Should I run/install the EntLib MSI and then run the "Install Services"
batch file?
Being cautious, I avoid installing anything I don't have to on the
production server.

Is there anything else I should be aware of to implement the EntLib DAAB?

Thanks for any pointers.

Al


Feb 17 '06 #3
Hmm - On examining the batch file behind the "Install Services", all this
does is copy the compiled DLL's from the EntLib /bin directory to the local
Visual Studio/ Common7/IDE folder.

It doesn't appear to make anything load into memory or register with GAC,
etc.

I was under the impression that the compiled DLL's should just be xcopied
along with the app's DLL and that should pretty much be it, just as I would
and have done for my other ASP.NET apps that are not using entlib.

I have looked into installing the EntLib package on my server, but to
compile it requires access to Visual Studio, because it uses a series of
solution files.

Why MS couldn't make the system compile directly from the Framework, I don't
know. I guess it's a fair assumption by them that if you're using the
EntLib, then you have VS, but that takes me back to my point above about
xcopy deployment - it's obviously not happening correctly in this particular
case.

We've all read about how all you need to get started in .NET is Notepad, the
Framework distributables and knowledge of the command-line compiler syntax
(I don't have this latter knowledge as I use and rely upon VS, but MS
certainly have people that do).

The only significant difference between the environments is that the
production version is using SSL, but my dev PC isn't. As far as I'm aware,
only my (solitary) cookie needs to be made aware of this difference by
setting it's .Secure property to true.

Has anyone else used the DAAB successfully with SSL?

Al
"Jose Rodriguez" <jo*********@yahoo.com> wrote in message
news:ej**************@TK2MSFTNGP09.phx.gbl...
Alec, I would say yes...install and run the services...DAAB has some built
in dependencies to other components of the Enterprise library. Good luck,

-Jose
"Alec MacLean" <al**********@NO-SPAM-copeohs.com> wrote in message
news:Ox**************@TK2MSFTNGP09.phx.gbl...
Hi all,

I'm trying to deploy an ASP.NET (1.1) app to our production webserver,
but having problems with the DAAB (from Ent Lib June 2005).
As you might guess, it works just fine and dandy on my dev PC (VS2003).

The error I'm getting on the production server is:
The type initializer for
"Microsoft.Practices.EnterpriseLibrary.Data.Instru mentation.DataConnectionFailedEvent"
threw an exception
Background info:
Using our own webserver, so I have direct folder access.
The application is for use on our Extranet and uses SSL for all comms.
Users access control is via Forms Auth (tried and tested methods used in
all our extranet apps).
I have used normal xcopy (cut & paste) deployment for the project folders
and aspx, dataconfiguration and dll files, then set up the virtual
directory on IIS, and enabled the required use of SSL on the new virtual
directory.
I have other apps using the direct ADO.NET data methods, which all work
fine, so the folder structure and setup is not something I'm concerned
about.
I've converted one page of my new app to use the direct methods and these
work OK, so I believe the virtual directory config and SQL permissions
can be eliminated as a problem and it narrows the problem directly to the
DAAB methods.

So the folder structure is:
<myWebsite>
+--<myAppVDir>
+--Bin
+--images

With the files in my app's V-Dir being:
all the aspx files, globa.asax, styles.css
dataconfiguration.config
web.config

Content of /bin:
My project's dll
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Configuratio n.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll

I have set a project-level Imports for the
Microsoft.Practices.EnterpriseLibrary.Data
The production versions of web.config and dataconfiguration.config files
have been modified to use the production instance of the SQL dbo.

I've narrowed down my problem specifically to the db.ExecuteReader method
used to load the IDataReader.

In Page_Load, call is made to method for retrieving users email address:

Private Sub GetStaffEmail()
Dim db As Database = DatabaseFactory.CreateDatabase
Dim cmd As DBCommandWrapper =
db.GetStoredProcCommandWrapper("usp_OnLine_EmailAd dr_for_Staff_SELECT")
Dim dataReader As IDataReader
'Add the required parameter:
cmd.AddInParameter("@ExtranetUSID", DbType.Int32, Me.intUSID)
Try
'Execute command and retrieve data:
dataReader = db.ExecuteReader(cmd) ' <--- Fails. Triggers exception
...
Catch
...
Finally
'Dispose of dataReader
...
End Try
End Sub

I have not installed or run any process specifically for the EntLib on
the server, other than copy the three DLL's as outlined above.
Should I run/install the EntLib MSI and then run the "Install Services"
batch file?
Being cautious, I avoid installing anything I don't have to on the
production server.

Is there anything else I should be aware of to implement the EntLib DAAB?

Thanks for any pointers.

Al


Feb 17 '06 #4
Check
http://blogs.msdn.com/tomholl/archiv...x?Pending=true

//quote

If you are deploying to an environment where the instrumentation cannot be
used, it's pretty easy to disable it, but you will need to recompile the
code. Luckily all the instrumentation code is wrapped around conditional
compilation directives, so you won't need to edit any source files directly.
Just go into the Project Properties dialog for the Common project, and under
Configuration Properties\Build, find the Conditional Compilation Properties
property and remove ;USEWMI;USEEVENTLOG;USEPERFORMANCECOUNTER (or any
combination of these that you don't want). Once you recompile, the relevant
instrumentation code will be disabled. Of course, it is still possible to
configure the Logging & Instrumentation Application Block to use WMI or
Event Log, so make sure you also choose appropriate settings for your
environment if you are using that block.
I removed these conditionals when I built my release version of the
EnterpriseLibrary.

Also, you can't ~just use EntLib.Practices.Data .. you need to include
xxxxxxx.Config.dll
xxxxxxx.Common.dll
(if my memory serves me correctly).

...

"Alec MacLean" <al**********@NO-SPAM-copeohs.com> wrote in message
news:Ox**************@TK2MSFTNGP09.phx.gbl...
Hi all,

I'm trying to deploy an ASP.NET (1.1) app to our production webserver, but
having problems with the DAAB (from Ent Lib June 2005).
As you might guess, it works just fine and dandy on my dev PC (VS2003).

The error I'm getting on the production server is:
The type initializer for
"Microsoft.Practices.EnterpriseLibrary.Data.Instru mentation.DataConnectionFa
iledEvent" threw an exception
Background info:
Using our own webserver, so I have direct folder access.
The application is for use on our Extranet and uses SSL for all comms.
Users access control is via Forms Auth (tried and tested methods used in all our extranet apps).
I have used normal xcopy (cut & paste) deployment for the project folders
and aspx, dataconfiguration and dll files, then set up the virtual directory on IIS, and enabled the required use of SSL on the new virtual directory.
I have other apps using the direct ADO.NET data methods, which all work
fine, so the folder structure and setup is not something I'm concerned
about.
I've converted one page of my new app to use the direct methods and these
work OK, so I believe the virtual directory config and SQL permissions can
be eliminated as a problem and it narrows the problem directly to the DAAB
methods.

So the folder structure is:
<myWebsite>
+--<myAppVDir>
+--Bin
+--images

With the files in my app's V-Dir being:
all the aspx files, globa.asax, styles.css
dataconfiguration.config
web.config

Content of /bin:
My project's dll
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Configuratio n.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll

I have set a project-level Imports for the
Microsoft.Practices.EnterpriseLibrary.Data
The production versions of web.config and dataconfiguration.config files
have been modified to use the production instance of the SQL dbo.

I've narrowed down my problem specifically to the db.ExecuteReader method
used to load the IDataReader.

In Page_Load, call is made to method for retrieving users email address:

Private Sub GetStaffEmail()
Dim db As Database = DatabaseFactory.CreateDatabase
Dim cmd As DBCommandWrapper =
db.GetStoredProcCommandWrapper("usp_OnLine_EmailAd dr_for_Staff_SELECT")
Dim dataReader As IDataReader
'Add the required parameter:
cmd.AddInParameter("@ExtranetUSID", DbType.Int32, Me.intUSID)
Try
'Execute command and retrieve data:
dataReader = db.ExecuteReader(cmd) ' <--- Fails. Triggers exception
...
Catch
...
Finally
'Dispose of dataReader
...
End Try
End Sub

I have not installed or run any process specifically for the EntLib on the
server, other than copy the three DLL's as outlined above.
Should I run/install the EntLib MSI and then run the "Install Services"
batch file?
Being cautious, I avoid installing anything I don't have to on the
production server.

Is there anything else I should be aware of to implement the EntLib DAAB?

Thanks for any pointers.

Al

Feb 17 '06 #5
Thanks Patrick - I'll investigate this and let you know if it helps.

Al
"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:ea**************@TK2MSFTNGP12.phx.gbl...
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...nstallUtil.exe
Hope that would solve your problem
** This did the trick on some PC's
Patrick
"Jose Rodriguez" <jo*********@yahoo.com> wrote in message
news:ej**************@TK2MSFTNGP09.phx.gbl...
Alec, I would say yes...install and run the services...DAAB has some
built in dependencies to other components of the Enterprise library. Good
luck,

-Jose
"Alec MacLean" <al**********@NO-SPAM-copeohs.com> wrote in message
news:Ox**************@TK2MSFTNGP09.phx.gbl...
Hi all,

I'm trying to deploy an ASP.NET (1.1) app to our production webserver,
but having problems with the DAAB (from Ent Lib June 2005).
As you might guess, it works just fine and dandy on my dev PC (VS2003).

The error I'm getting on the production server is:
The type initializer for
"Microsoft.Practices.EnterpriseLibrary.Data.Instru mentation.DataConnectionFailedEvent"
threw an exception
Background info:
Using our own webserver, so I have direct folder access.
The application is for use on our Extranet and uses SSL for all comms.
Users access control is via Forms Auth (tried and tested methods used in
all our extranet apps).
I have used normal xcopy (cut & paste) deployment for the project
folders and aspx, dataconfiguration and dll files, then set up the
virtual directory on IIS, and enabled the required use of SSL on the new
virtual directory.
I have other apps using the direct ADO.NET data methods, which all work
fine, so the folder structure and setup is not something I'm concerned
about.
I've converted one page of my new app to use the direct methods and
these work OK, so I believe the virtual directory config and SQL
permissions can be eliminated as a problem and it narrows the problem
directly to the DAAB methods.

So the folder structure is:
<myWebsite>
+--<myAppVDir>
+--Bin
+--images

With the files in my app's V-Dir being:
all the aspx files, globa.asax, styles.css
dataconfiguration.config
web.config

Content of /bin:
My project's dll
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Configuratio n.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll

I have set a project-level Imports for the
Microsoft.Practices.EnterpriseLibrary.Data
The production versions of web.config and dataconfiguration.config files
have been modified to use the production instance of the SQL dbo.

I've narrowed down my problem specifically to the db.ExecuteReader
method used to load the IDataReader.

In Page_Load, call is made to method for retrieving users email address:

Private Sub GetStaffEmail()
Dim db As Database = DatabaseFactory.CreateDatabase
Dim cmd As DBCommandWrapper =
db.GetStoredProcCommandWrapper("usp_OnLine_EmailAd dr_for_Staff_SELECT")
Dim dataReader As IDataReader
'Add the required parameter:
cmd.AddInParameter("@ExtranetUSID", DbType.Int32, Me.intUSID)
Try
'Execute command and retrieve data:
dataReader = db.ExecuteReader(cmd) ' <--- Fails. Triggers exception
...
Catch
...
Finally
'Dispose of dataReader
...
End Try
End Sub

I have not installed or run any process specifically for the EntLib on
the server, other than copy the three DLL's as outlined above.
Should I run/install the EntLib MSI and then run the "Install Services"
batch file?
Being cautious, I avoid installing anything I don't have to on the
production server.

Is there anything else I should be aware of to implement the EntLib
DAAB?

Thanks for any pointers.

Al



Feb 17 '06 #6
Hi Sloan,

Already saw that, thanks. My project hasn't got any of the mentioned (or
any etra) directives set, so couldn't remove them...

I'm going to follow up on Patrick O. Ige's response, as this seems to hold
some promise.

Thanks

Al
"sloan" <sl***@ipass.net> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Check
http://blogs.msdn.com/tomholl/archiv...x?Pending=true

//quote

If you are deploying to an environment where the instrumentation cannot be
used, it's pretty easy to disable it, but you will need to recompile the
code. Luckily all the instrumentation code is wrapped around conditional
compilation directives, so you won't need to edit any source files
directly.
Just go into the Project Properties dialog for the Common project, and
under
Configuration Properties\Build, find the Conditional Compilation
Properties
property and remove ;USEWMI;USEEVENTLOG;USEPERFORMANCECOUNTER (or any
combination of these that you don't want). Once you recompile, the
relevant
instrumentation code will be disabled. Of course, it is still possible to
configure the Logging & Instrumentation Application Block to use WMI or
Event Log, so make sure you also choose appropriate settings for your
environment if you are using that block.
I removed these conditionals when I built my release version of the
EnterpriseLibrary.

Also, you can't ~just use EntLib.Practices.Data .. you need to include
xxxxxxx.Config.dll
xxxxxxx.Common.dll
(if my memory serves me correctly).

..

"Alec MacLean" <al**********@NO-SPAM-copeohs.com> wrote in message
news:Ox**************@TK2MSFTNGP09.phx.gbl...
Hi all,

I'm trying to deploy an ASP.NET (1.1) app to our production webserver,
but
having problems with the DAAB (from Ent Lib June 2005).
As you might guess, it works just fine and dandy on my dev PC (VS2003).

The error I'm getting on the production server is:
The type initializer for

"Microsoft.Practices.EnterpriseLibrary.Data.Instru mentation.DataConnectionFa
iledEvent"
threw an exception
Background info:
Using our own webserver, so I have direct folder access.
The application is for use on our Extranet and uses SSL for all comms.
Users access control is via Forms Auth (tried and tested methods used in

all
our extranet apps).
I have used normal xcopy (cut & paste) deployment for the project folders
and aspx, dataconfiguration and dll files, then set up the virtual

directory
on IIS, and enabled the required use of SSL on the new virtual directory.
I have other apps using the direct ADO.NET data methods, which all work
fine, so the folder structure and setup is not something I'm concerned
about.
I've converted one page of my new app to use the direct methods and these
work OK, so I believe the virtual directory config and SQL permissions
can
be eliminated as a problem and it narrows the problem directly to the
DAAB
methods.

So the folder structure is:
<myWebsite>
+--<myAppVDir>
+--Bin
+--images

With the files in my app's V-Dir being:
all the aspx files, globa.asax, styles.css
dataconfiguration.config
web.config

Content of /bin:
My project's dll
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Configuratio n.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll

I have set a project-level Imports for the
Microsoft.Practices.EnterpriseLibrary.Data
The production versions of web.config and dataconfiguration.config files
have been modified to use the production instance of the SQL dbo.

I've narrowed down my problem specifically to the db.ExecuteReader method
used to load the IDataReader.

In Page_Load, call is made to method for retrieving users email address:

Private Sub GetStaffEmail()
Dim db As Database = DatabaseFactory.CreateDatabase
Dim cmd As DBCommandWrapper =
db.GetStoredProcCommandWrapper("usp_OnLine_EmailAd dr_for_Staff_SELECT")
Dim dataReader As IDataReader
'Add the required parameter:
cmd.AddInParameter("@ExtranetUSID", DbType.Int32, Me.intUSID)
Try
'Execute command and retrieve data:
dataReader = db.ExecuteReader(cmd) ' <--- Fails. Triggers exception
...
Catch
...
Finally
'Dispose of dataReader
...
End Try
End Sub

I have not installed or run any process specifically for the EntLib on
the
server, other than copy the three DLL's as outlined above.
Should I run/install the EntLib MSI and then run the "Install Services"
batch file?
Being cautious, I avoid installing anything I don't have to on the
production server.

Is there anything else I should be aware of to implement the EntLib DAAB?

Thanks for any pointers.

Al


Feb 17 '06 #7
Excellent Patrick! Using InstallUtil has done the trick - thank you.

Just to clarify for anyone else reading this thread, InstallUtil is run on
the server itself (using remote desktop terminal session) from the new
application's bin folder, _not_ from my dev PC against the server's
deployment location.

Al
"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:ea**************@TK2MSFTNGP12.phx.gbl...
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...nstallUtil.exe
Hope that would solve your problem
** This did the trick on some PC's
Patrick
"Jose Rodriguez" <jo*********@yahoo.com> wrote in message
news:ej**************@TK2MSFTNGP09.phx.gbl...
Alec, I would say yes...install and run the services...DAAB has some
built in dependencies to other components of the Enterprise library. Good
luck,

-Jose
"Alec MacLean" <al**********@NO-SPAM-copeohs.com> wrote in message
news:Ox**************@TK2MSFTNGP09.phx.gbl...
Hi all,

I'm trying to deploy an ASP.NET (1.1) app to our production webserver,
but having problems with the DAAB (from Ent Lib June 2005).
As you might guess, it works just fine and dandy on my dev PC (VS2003).

The error I'm getting on the production server is:
The type initializer for
"Microsoft.Practices.EnterpriseLibrary.Data.Instru mentation.DataConnectionFailedEvent"
threw an exception
Background info:
Using our own webserver, so I have direct folder access.
The application is for use on our Extranet and uses SSL for all comms.
Users access control is via Forms Auth (tried and tested methods used in
all our extranet apps).
I have used normal xcopy (cut & paste) deployment for the project
folders and aspx, dataconfiguration and dll files, then set up the
virtual directory on IIS, and enabled the required use of SSL on the new
virtual directory.
I have other apps using the direct ADO.NET data methods, which all work
fine, so the folder structure and setup is not something I'm concerned
about.
I've converted one page of my new app to use the direct methods and
these work OK, so I believe the virtual directory config and SQL
permissions can be eliminated as a problem and it narrows the problem
directly to the DAAB methods.

So the folder structure is:
<myWebsite>
+--<myAppVDir>
+--Bin
+--images

With the files in my app's V-Dir being:
all the aspx files, globa.asax, styles.css
dataconfiguration.config
web.config

Content of /bin:
My project's dll
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Configuratio n.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll

I have set a project-level Imports for the
Microsoft.Practices.EnterpriseLibrary.Data
The production versions of web.config and dataconfiguration.config files
have been modified to use the production instance of the SQL dbo.

I've narrowed down my problem specifically to the db.ExecuteReader
method used to load the IDataReader.

In Page_Load, call is made to method for retrieving users email address:

Private Sub GetStaffEmail()
Dim db As Database = DatabaseFactory.CreateDatabase
Dim cmd As DBCommandWrapper =
db.GetStoredProcCommandWrapper("usp_OnLine_EmailAd dr_for_Staff_SELECT")
Dim dataReader As IDataReader
'Add the required parameter:
cmd.AddInParameter("@ExtranetUSID", DbType.Int32, Me.intUSID)
Try
'Execute command and retrieve data:
dataReader = db.ExecuteReader(cmd) ' <--- Fails. Triggers exception
...
Catch
...
Finally
'Dispose of dataReader
...
End Try
End Sub

I have not installed or run any process specifically for the EntLib on
the server, other than copy the three DLL's as outlined above.
Should I run/install the EntLib MSI and then run the "Install Services"
batch file?
Being cautious, I avoid installing anything I don't have to on the
production server.

Is there anything else I should be aware of to implement the EntLib
DAAB?

Thanks for any pointers.

Al



Feb 17 '06 #8

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

Similar topics

0
by: sedefo | last post by:
I ran into this Microsoft Patterns & Practices Enterprise Library while i was researching how i can write a database independent data access layer. In my company we already use Data Access...
6
by: BuddyWork | last post by:
Does anyone know if there are any articles explaining how I could debug into SqlCommand.ExecuteReader so I can see why I am getting a particular error. thanks
0
by: BuddyWork | last post by:
Hello, The problem is that when using SqlCommand.ExecuteReader and the SQL statement raises an error of severity of 16 then ExecuteReader throws an exception, when you use...
3
by: veera sekhar kota | last post by:
hi, im seriously looking for right answer .... We are developing windows application in c#. I implemented DAAB(Data Access Application Block) 2.0 in our application. One of the senior asked...
7
by: hansiman | last post by:
I'm unsure if I should call the close method (dr.Close()) of the sqldatareader after the following code: Dim dr As SqlDataReader = SqlHelper.ExecuteReader(strConn, CommandType.StoredProcedure,...
18
by: Chubbly Geezer | last post by:
Now I'm coming from a VB6 background so I may be overlooking something here. I have functionality that is contained with 2 VB 2005 dll's. WARC_Subs_Reporting.dll which handles report functions...
8
by: Alec MacLean | last post by:
Hi, I'm using the DAAB Ent Lib (Jan 2006) for .NET 2.0, with VS 2005 Pro. My project is a Web app project (using the WAP add in). Background: I'm creating a survey system for our company, for...
2
by: =?Utf-8?B?TWlrZVo=?= | last post by:
I created a function to use DAAB return a datareader. The connection must keep opening when I consume the datareader. 1. I tested the function, it works. Even I use the datareader after 10...
7
by: fniles | last post by:
I am using VB.Net 2003 and MS Access (connecting using OleDBConnection). I read using DataAdapter and DataSet, not DataReader. When many people try to access the database at the same time, I get...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.