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 and has a reference
to WARC_Standard_Functions which holds the day to day functionality and has
references to Microsoft.Practices.EnterpriseLibrary.Data.dll and
Microsoft.Practices.EnterpriseLibrary.Common.dll
I want WARC_Subs_Reporting.dll available to MS Access 2003 and so have
assigned Strong Names to all of the above. I have created an install
routine for WARC_Subs_Reporting.dll which then has the other 3 named dll's
as references. The install when run installs all 4 dll's to the correct
directory. I then add WARC_Subs_Reporting.dll to the GAC as it is the only
dll I require to access from COM.
I've now created a dummy VB 2005 project to test the installed dll. When I
step through, it calls a procedure within WARC_Subs_Reporting.dll, which
calls a procedure within WARC_Standard_Functions that creates a dataset by
using the procedures within the DAAB. However, it always falls over on the
following line of code within the DAAB:
return EnterpriseLibraryFactory.BuildUp<T>(name, configurationSource);
within the 'public T Create(string name)' procedure within the
'NameTypeFactoryBase' class.
Giving this error:
The type initializer for
'Microsoft.Practices.EnterpriseLibrary.Common.Conf iguration.ObjectBuilder.EnterpriseLibraryFactory'
threw an exception.
Now, to be honest, I have no idea what this is and cannot find any useful
help on the matter. Any ideas.
Thanks
Chubbly 18 4095
Chubbly,
Have you tried to debug this? There should also be information in the
Message property of the exception. Also, be sure to check the
InnerException property. It looks like there is a static constructor for
the
Microsoft.Practices.EnterpriseLibrary.Common.Confi guration.ObjectBuilder.EnterpriseLibraryFactory
class which is throwing an exception.
Also, a comment on your installation. While you might only be exposing
classes from one assembly in the GAC, you should have all of the references
that the assembly has in the GAC as well. It doesn't make sense to have
just the one assembly in the GAC and the others be private, when you know
that it will require those references.
The idea here is to distrubute those assemblies as a logical unit, which
you are currently breaking up.
Adding them to the GAC won't make them visible to COM, it will just
enforce that logical unit.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Chubbly Geezer" <ch************@newsgroup.nospam> wrote in message
news:OI**************@TK2MSFTNGP04.phx.gbl... 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 and has a reference to WARC_Standard_Functions which holds the day to day functionality and has references to Microsoft.Practices.EnterpriseLibrary.Data.dll and Microsoft.Practices.EnterpriseLibrary.Common.dll
I want WARC_Subs_Reporting.dll available to MS Access 2003 and so have assigned Strong Names to all of the above. I have created an install routine for WARC_Subs_Reporting.dll which then has the other 3 named dll's as references. The install when run installs all 4 dll's to the correct directory. I then add WARC_Subs_Reporting.dll to the GAC as it is the only dll I require to access from COM.
I've now created a dummy VB 2005 project to test the installed dll. When I step through, it calls a procedure within WARC_Subs_Reporting.dll, which calls a procedure within WARC_Standard_Functions that creates a dataset by using the procedures within the DAAB. However, it always falls over on the following line of code within the DAAB:
return EnterpriseLibraryFactory.BuildUp<T>(name, configurationSource);
within the 'public T Create(string name)' procedure within the 'NameTypeFactoryBase' class.
Giving this error:
The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Common.Conf iguration.ObjectBuilder.EnterpriseLibraryFactory' threw an exception.
Now, to be honest, I have no idea what this is and cannot find any useful help on the matter. Any ideas.
Thanks
Chubbly
The enterprise library uses config information to build its connection
string.
Take a look here.
Your configuration information is probably off/wrong. http://davidhayden.com/blog/dave/arc...1/08/2686.aspx
"Chubbly Geezer" <ch************@newsgroup.nospam> wrote in message
news:OI**************@TK2MSFTNGP04.phx.gbl... 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 and has a reference to WARC_Standard_Functions which holds the day to day functionality and
has references to Microsoft.Practices.EnterpriseLibrary.Data.dll and Microsoft.Practices.EnterpriseLibrary.Common.dll
I want WARC_Subs_Reporting.dll available to MS Access 2003 and so have assigned Strong Names to all of the above. I have created an install routine for WARC_Subs_Reporting.dll which then has the other 3 named dll's as references. The install when run installs all 4 dll's to the correct directory. I then add WARC_Subs_Reporting.dll to the GAC as it is the
only dll I require to access from COM.
I've now created a dummy VB 2005 project to test the installed dll. When
I step through, it calls a procedure within WARC_Subs_Reporting.dll, which calls a procedure within WARC_Standard_Functions that creates a dataset by using the procedures within the DAAB. However, it always falls over on
the following line of code within the DAAB:
return EnterpriseLibraryFactory.BuildUp<T>(name, configurationSource);
within the 'public T Create(string name)' procedure within the 'NameTypeFactoryBase' class.
Giving this error:
The type initializer for
'Microsoft.Practices.EnterpriseLibrary.Common.Conf iguration.ObjectBuilder.En
terpriseLibraryFactory' threw an exception.
Now, to be honest, I have no idea what this is and cannot find any useful help on the matter. Any ideas.
Thanks
Chubbly
Nicolas
thanks for the quick response.
I am unable to find any info on the inner exception, but copying this error
to the clipboard produces the following:
System.TypeInitializationException was unhandled
Message="The type initializer for
'Microsoft.Practices.EnterpriseLibrary.Common.Conf iguration.ObjectBuilder.EnterpriseLibraryFactory'
threw an exception."
Source="Microsoft.Practices.EnterpriseLibrary.Comm on"
TypeName="Microsoft.Practices.EnterpriseLibrary.Co mmon.Configuration.ObjectBuilder.EnterpriseLibrary Factory"
StackTrace:
at
Microsoft.Practices.EnterpriseLibrary.Common.Confi guration.ObjectBuilder.EnterpriseLibraryFactory.Bu ildUp[T](String
id, IConfigurationSource configurationSource)
at
Microsoft.Practices.EnterpriseLibrary.Common.Confi guration.ObjectBuilder.NameTypeFactoryBase`1.Creat e(String
name)
at
Microsoft.Practices.EnterpriseLibrary.Data.Databas eFactory.CreateDatabase(String
name)
at SharedFunctions.clsConnection.CreateDataset(String strSQL, String
conn)
at WARC_Subs_Reporting.modRenewal.AgentsRenewalsCheck ()
at WARC_Subs_Reporting.clsPublic.AgentsRenewal()
at WindowsApplication3.Form1.Button1_Click(Object sender, EventArgs
e) in C:\temp\2005\WindowsApplication3\WindowsApplicatio n3\Form1.vb:line 8
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG&
msg)
at
System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationCo ntext context)
at
Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.OnRun()
at
Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.Run(String[]
commandLine)
at WindowsApplication3.My.MyApplication.Main(String[] Args) in
17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
with which I am totally lost. I can see where the error is happening but
not too sure how to resolve.
Chubbly
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eo**************@TK2MSFTNGP03.phx.gbl... Chubbly,
Have you tried to debug this? There should also be information in the Message property of the exception. Also, be sure to check the InnerException property. It looks like there is a static constructor for the Microsoft.Practices.EnterpriseLibrary.Common.Confi guration.ObjectBuilder.EnterpriseLibraryFactory class which is throwing an exception.
Also, a comment on your installation. While you might only be exposing classes from one assembly in the GAC, you should have all of the references that the assembly has in the GAC as well. It doesn't make sense to have just the one assembly in the GAC and the others be private, when you know that it will require those references.
The idea here is to distrubute those assemblies as a logical unit, which you are currently breaking up.
Adding them to the GAC won't make them visible to COM, it will just enforce that logical unit.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Chubbly Geezer" <ch************@newsgroup.nospam> wrote in message news:OI**************@TK2MSFTNGP04.phx.gbl... 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 and has a reference to WARC_Standard_Functions which holds the day to day functionality and has references to Microsoft.Practices.EnterpriseLibrary.Data.dll and Microsoft.Practices.EnterpriseLibrary.Common.dll
I want WARC_Subs_Reporting.dll available to MS Access 2003 and so have assigned Strong Names to all of the above. I have created an install routine for WARC_Subs_Reporting.dll which then has the other 3 named dll's as references. The install when run installs all 4 dll's to the correct directory. I then add WARC_Subs_Reporting.dll to the GAC as it is the only dll I require to access from COM.
I've now created a dummy VB 2005 project to test the installed dll. When I step through, it calls a procedure within WARC_Subs_Reporting.dll, which calls a procedure within WARC_Standard_Functions that creates a dataset by using the procedures within the DAAB. However, it always falls over on the following line of code within the DAAB:
return EnterpriseLibraryFactory.BuildUp<T>(name, configurationSource);
within the 'public T Create(string name)' procedure within the 'NameTypeFactoryBase' class.
Giving this error:
The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Common.Conf iguration.ObjectBuilder.EnterpriseLibraryFactory' threw an exception.
Now, to be honest, I have no idea what this is and cannot find any useful help on the matter. Any ideas.
Thanks
Chubbly
Hi Chubbly,
If you step into the code, on which line was the exception thrown?
Kevin Yu
Microsoft Online Community Support
================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
It seems the inner exception is
System.IO.FileNotFoundException
"Chubbly Geezer" <ch************@newsgroup.nospam> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl... Nicolas
thanks for the quick response.
I am unable to find any info on the inner exception, but copying this error to the clipboard produces the following:
System.TypeInitializationException was unhandled Message="The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Common.Conf iguration.ObjectBuilder.EnterpriseLibraryFactory' threw an exception." Source="Microsoft.Practices.EnterpriseLibrary.Comm on"
TypeName="Microsoft.Practices.EnterpriseLibrary.Co mmon.Configuration.ObjectBuilder.EnterpriseLibrary Factory" StackTrace: at Microsoft.Practices.EnterpriseLibrary.Common.Confi guration.ObjectBuilder.EnterpriseLibraryFactory.Bu ildUp[T](String id, IConfigurationSource configurationSource) at Microsoft.Practices.EnterpriseLibrary.Common.Confi guration.ObjectBuilder.NameTypeFactoryBase`1.Creat e(String name) at Microsoft.Practices.EnterpriseLibrary.Data.Databas eFactory.CreateDatabase(String name) at SharedFunctions.clsConnection.CreateDataset(String strSQL, String conn) at WARC_Subs_Reporting.modRenewal.AgentsRenewalsCheck () at WARC_Subs_Reporting.clsPublic.AgentsRenewal() at WindowsApplication3.Form1.Button1_Click(Object sender, EventArgs e) in C:\temp\2005\WindowsApplication3\WindowsApplicatio n3\Form1.vb:line 8 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(ApplicationCo ntext context) at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.Run(String[] commandLine) at WindowsApplication3.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context( Object state) at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
with which I am totally lost. I can see where the error is happening but not too sure how to resolve.
Chubbly "Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:eo**************@TK2MSFTNGP03.phx.gbl... Chubbly,
Have you tried to debug this? There should also be information in the Message property of the exception. Also, be sure to check the InnerException property. It looks like there is a static constructor for the Microsoft.Practices.EnterpriseLibrary.Common.Confi guration.ObjectBuilder.EnterpriseLibraryFactory class which is throwing an exception.
Also, a comment on your installation. While you might only be exposing classes from one assembly in the GAC, you should have all of the references that the assembly has in the GAC as well. It doesn't make sense to have just the one assembly in the GAC and the others be private, when you know that it will require those references.
The idea here is to distrubute those assemblies as a logical unit, which you are currently breaking up.
Adding them to the GAC won't make them visible to COM, it will just enforce that logical unit.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Chubbly Geezer" <ch************@newsgroup.nospam> wrote in message news:OI**************@TK2MSFTNGP04.phx.gbl... 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 and has a reference to WARC_Standard_Functions which holds the day to day functionality and has references to Microsoft.Practices.EnterpriseLibrary.Data.dll and Microsoft.Practices.EnterpriseLibrary.Common.dll
I want WARC_Subs_Reporting.dll available to MS Access 2003 and so have assigned Strong Names to all of the above. I have created an install routine for WARC_Subs_Reporting.dll which then has the other 3 named dll's as references. The install when run installs all 4 dll's to the correct directory. I then add WARC_Subs_Reporting.dll to the GAC as it is the only dll I require to access from COM.
I've now created a dummy VB 2005 project to test the installed dll. When I step through, it calls a procedure within WARC_Subs_Reporting.dll, which calls a procedure within WARC_Standard_Functions that creates a dataset by using the procedures within the DAAB. However, it always falls over on the following line of code within the DAAB:
return EnterpriseLibraryFactory.BuildUp<T>(name, configurationSource);
within the 'public T Create(string name)' procedure within the 'NameTypeFactoryBase' class.
Giving this error:
The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Common.Conf iguration.ObjectBuilder.EnterpriseLibraryFactory' threw an exception.
Now, to be honest, I have no idea what this is and cannot find any useful help on the matter. Any ideas.
Thanks
Chubbly
Hi Kevin
It always falls over on the following line of code within
Microsoft.Practices.EnterpriseLibrary.Common.dll:
return EnterpriseLibraryFactory.BuildUp<T>(name, configurationSource);
within the 'public T Create(string name)' procedure within the
'NameTypeFactoryBase' class.
Giving this error:
The type initializer for
'Microsoft.Practices.EnterpriseLibrary.Common.Conf iguration.ObjectBuilder.EnterpriseLibraryFactory'
threw an exception.
The inner exception appears to be 'System.IO.FileNotFoundException'
Any help would be appreciated.
Chubbly
"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:Gy**************@TK2MSFTNGXA01.phx.gbl... Hi Chubbly,
If you step into the code, on which line was the exception thrown?
Kevin Yu Microsoft Online Community Support
================================================== ========================== ========================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== ========================== ==========================
(This posting is provided "AS IS", with no warranties, and confers no rights.)
I appear to have tracked down what I think is the error.
"The requested database Subscriptions2_Test is not defined in configuration."
This is being thrown from within the 'DatabaseFactory.cs' class and the 'CreateDatabase' method.
Subscriptions2_Test is the name of the default connection within my app.config in my WARC_Standard_Functions.dll
Do I maybe need to create an app.config file for the DatabaseFactory ..?
"Chubbly Geezer" <ch************@newsgroup.nospam> wrote in message news:uh****************@TK2MSFTNGP02.phx.gbl... Hi Kevin It always falls over on the following line of code within Microsoft.Practices.EnterpriseLibrary.Common.dll: return EnterpriseLibraryFactory.BuildUp<T>(name, configurationSource); within the 'public T Create(string name)' procedure within the 'NameTypeFactoryBase' class. Giving this error: The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Common.Conf iguration.ObjectBuilder..EnterpriseLibraryFactory' threw an exception. The inner exception appears to be 'System.IO.FileNotFoundException' Any help would be appreciated. Chubbly "Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message news:Gy**************@TK2MSFTNGXA01.phx.gbl... Hi Chubbly,
If you step into the code, on which line was the exception thrown?
Kevin Yu Microsoft Online Community Support
================================================== ========================== ========================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== ========================== ==========================
(This posting is provided "AS IS", with no warranties, and confers no rights.)
Hi Chubby,
Since the inner exception is a FileNotFoundException, could you please if
you're missing something? Are the assemblies you're referencing all exists
and registered successfully?
I agree with Nicholas that the assemblies referenced by assembly in GAC
should all be in GAC.
Kevin Yu
Microsoft Online Community Support
================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
I don't appear to be missing anything. I have reinstalled the Enterprise
Library in full.
My WARC_Subs_Reporting.dll references WARC_Shared_Functions.dll which in
turn references 2 enterprise library dll's. My setup project for
WARC_Subs_Reporting.dll shows the other 3 dll's as dependencies. Upon
install, all 4 dll's are copied to the correct directory as expected.
When I then run my test project which references WARC_Subs_Reporting.dll, I
can step through until I receive the error. This happens whether I add the
dll's to the GAC or not.
"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:M%****************@TK2MSFTNGXA01.phx.gbl... Hi Chubby,
Since the inner exception is a FileNotFoundException, could you please if you're missing something? Are the assemblies you're referencing all exists and registered successfully?
I agree with Nicholas that the assemblies referenced by assembly in GAC should all be in GAC.
Kevin Yu Microsoft Online Community Support
================================================== ========================== ========================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== ========================== ==========================
(This posting is provided "AS IS", with no warranties, and confers no rights.)
When I create a database I use the following procedure:
Public Class clsConnection
Function CreateDataset(ByVal strSQL As String, ByVal conn As String) As DataSet
Dim db As Database = DatabaseFactory.CreateDatabase(conn)
Dim sqlcommand As String = strSQL
Dim dbcommand As System.Data.Common.DbCommand = db.GetSqlStringCommand(sqlcommand)
Dim ds As DataSet = db.ExecuteDataSet(dbcommand)
Return ds
End Function
as you can see I am supplying an argument ('conn' in this case Subscriptions2_Test) for the 'DatabaseFactory.CreateDatabase'. It seems to me that the problem is here somewhere. The demo app supllied with Ent Lib does not use this argument.
I have an app.config file included as part of my dll which looks like this:
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.C onfiguration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data" />
</configSections>
<connectionStrings>
<add name="WarcLog_Test" connectionString="server=WEBDEV;database=WARCLog;I ntegrated Security=true"
providerName="System.Data.SqlClient" />
<add name="Subscriptions2_Test" connectionString="server=WEBDEV;database=Subscript ions2;Integrated Security=true"
providerName="System.Data.SqlClient" />
<add name="WarcLog" connectionString="server=WARC;database=WARCLog;Int egrated Security=true"
providerName="System.Data.SqlClient" />
<add name="Subscriptions" connectionString="server=ACC_SQL2K;database=Subscr iptions;Integrated Security=true"
providerName="System.Data.SqlClient" />
</connectionStrings>
<dataConfiguration defaultDatabase="Subscriptions2_Test"/>
</configuration>
It appears that this database connection string is not being found when I run the installed app. I'm sure there must be a simple solution here.
"Chubbly Geezer" <ch************@newsgroup.nospam> wrote in message news:ec**************@TK2MSFTNGP02.phx.gbl... I don't appear to be missing anything. I have reinstalled the Enterprise Library in full. My WARC_Subs_Reporting.dll references WARC_Shared_Functions.dll which in turn references 2 enterprise library dll's. My setup project for WARC_Subs_Reporting.dll shows the other 3 dll's as dependencies. Upon install, all 4 dll's are copied to the correct directory as expected. When I then run my test project which references WARC_Subs_Reporting.dll, I can step through until I receive the error. This happens whether I add the dll's to the GAC or not. "Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message news:M%****************@TK2MSFTNGXA01.phx.gbl... Hi Chubby,
Since the inner exception is a FileNotFoundException, could you please if you're missing something? Are the assemblies you're referencing all exists and registered successfully?
I agree with Nicholas that the assemblies referenced by assembly in GAC should all be in GAC.
Kevin Yu Microsoft Online Community Support
================================================== ========================== ========================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== ========================== ==========================
(This posting is provided "AS IS", with no warranties, and confers no rights.)
Hi Chubbly,
Based on my analyze, the configurationSource in your buidUp method might be
incorrect. Has the configuration file been put to a directory that the
enterprise library can see? Please use F11 to step into the method and
check the value for configurationSource.
Kevin Yu
Microsoft Online Community Support
================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
I have now removed this DB argument and the app errors when trying to find the default database.
I have a config file in both my DLL's and now also in the Enterprise Library Data DLL, but it still cannot find the entries within it and so I suspect cannot see the config file at all.
"Chubbly Geezer" <ch************@newsgroup.nospam> wrote in message news:uq**************@TK2MSFTNGP05.phx.gbl...
When I create a database I use the following procedure:
Public Class clsConnection
Function CreateDataset(ByVal strSQL As String, ByVal conn As String) As DataSet
Dim db As Database = DatabaseFactory.CreateDatabase(conn)
Dim sqlcommand As String = strSQL
Dim dbcommand As System.Data.Common.DbCommand = db.GetSqlStringCommand(sqlcommand)
Dim ds As DataSet = db.ExecuteDataSet(dbcommand)
Return ds
End Function
as you can see I am supplying an argument ('conn' in this case Subscriptions2_Test) for the 'DatabaseFactory.CreateDatabase'. It seems to me that the problem is here somewhere. The demo app supllied with Ent Lib does not use this argument.
I have an app.config file included as part of my dll which looks like this:
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.C onfiguration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data" />
</configSections>
<connectionStrings>
<add name="WarcLog_Test" connectionString="server=WEBDEV;database=WARCLog;I ntegrated Security=true"
providerName="System.Data.SqlClient" />
<add name="Subscriptions2_Test" connectionString="server=WEBDEV;database=Subscript ions2;Integrated Security=true"
providerName="System.Data.SqlClient" />
<add name="WarcLog" connectionString="server=WARC;database=WARCLog;Int egrated Security=true"
providerName="System.Data.SqlClient" />
<add name="Subscriptions" connectionString="server=ACC_SQL2K;database=Subscr iptions;Integrated Security=true"
providerName="System.Data.SqlClient" />
</connectionStrings>
<dataConfiguration defaultDatabase="Subscriptions2_Test"/>
</configuration>
It appears that this database connection string is not being found when I run the installed app. I'm sure there must be a simple solution here.
"Chubbly Geezer" <ch************@newsgroup.nospam> wrote in message news:ec**************@TK2MSFTNGP02.phx.gbl... I don't appear to be missing anything. I have reinstalled the Enterprise Library in full. My WARC_Subs_Reporting.dll references WARC_Shared_Functions.dll which in turn references 2 enterprise library dll's. My setup project for WARC_Subs_Reporting.dll shows the other 3 dll's as dependencies. Upon install, all 4 dll's are copied to the correct directory as expected. When I then run my test project which references WARC_Subs_Reporting.dll, I can step through until I receive the error. This happens whether I add the dll's to the GAC or not. "Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message news:M%****************@TK2MSFTNGXA01.phx.gbl... Hi Chubby,
Since the inner exception is a FileNotFoundException, could you please if you're missing something? Are the assemblies you're referencing all exists and registered successfully?
I agree with Nicholas that the assemblies referenced by assembly in GAC should all be in GAC.
Kevin Yu Microsoft Online Community Support
================================================== ========================== ========================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== ========================== ==========================
(This posting is provided "AS IS", with no warranties, and confers no rights.)
My test app is called WindowsApplication3
When I run, it steps through my DLL's and into the EntLib DLL's with the
configurationsource showing as :
C:\temp\2005\WindowsApplication3\WindowsApplicatio n3\bin\Debug\WindowsApplication3.vshost.exe.config
which does not exist.
"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:EJ**************@TK2MSFTNGXA01.phx.gbl... Hi Chubbly,
Based on my analyze, the configurationSource in your buidUp method might be incorrect. Has the configuration file been put to a directory that the enterprise library can see? Please use F11 to step into the method and check the value for configurationSource.
Kevin Yu Microsoft Online Community Support
================================================== ========================== ========================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== ========================== ==========================
(This posting is provided "AS IS", with no warranties, and confers no rights.)
OK, I've wasted too much time so I'm going to give up trying to get this to work.
I've replaced
Dim db As Database = DatabaseFactory.CreateDatabase(conn)
with
Dim db As SqlDatabase = New SqlDatabase(conn)
and all seems to work fine at the moment.
I eventually found this on someone's blog. Is it me, but I can't find any actual documentation for the Enterprise Library. I wish I'd left my original code in place, this all seems like a bit too much hassle.
"Chubbly Geezer" <ch************@newsgroup.nospam> wrote in message news:eY**************@TK2MSFTNGP05.phx.gbl... My test app is called WindowsApplication3 When I run, it steps through my DLL's and into the EntLib DLL's with the configurationsource showing as : C:\temp\2005\WindowsApplication3\WindowsApplicatio n3\bin\Debug\WindowsApplication3.vshost.exe.config which does not exist. "Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message news:EJ**************@TK2MSFTNGXA01.phx.gbl... Hi Chubbly,
Based on my analyze, the configurationSource in your buidUp method might be incorrect. Has the configuration file been put to a directory that the enterprise library can see? Please use F11 to step into the method and check the value for configurationSource.
Kevin Yu Microsoft Online Community Support
================================================== ========================== ========================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== ========================== ==========================
(This posting is provided "AS IS", with no warranties, and confers no rights.)
Hi Chubby,
This seems to be the problem. The enterprise library will get the database
connection string from an app.config file. Since you mentioned that you
have supplied the app.config file, please check if
WindowsApplication3.vshost.exe.config or WindowsApplication3.exe.config is
in the Debug folder.
Kevin Yu
Microsoft Online Community Support
================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Thanks very much for your help Kevin, but I've wasted too much time already.
I need to move on.
Chubbly
"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:Sx**************@TK2MSFTNGXA01.phx.gbl... Hi Chubby,
This seems to be the problem. The enterprise library will get the database connection string from an app.config file. Since you mentioned that you have supplied the app.config file, please check if WindowsApplication3.vshost.exe.config or WindowsApplication3.exe.config is in the Debug folder.
Kevin Yu Microsoft Online Community Support
================================================== ========================== ========================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== ========================== ==========================
(This posting is provided "AS IS", with no warranties, and confers no rights.)
Hi Chubbly,
Sorry that I didn't provide much useful information. Good luck!
Kevin Yu
Microsoft Online Community Support
================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
I had the same trouble and after spend several hours i got the solution:
you must add a reference to the Microsoft.Practices.ObjectBuilder.dll
assembly.
that's all!
*** Sent via Developersdex http://www.developersdex.com *** This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rick |
last post by:
After upgrading to .Net 1.1 and VS.Net 2003 the Oracle DAAB is busted.
There was a previous post with no followup in the last month so I am
reposting the issue in hopes that someone has already...
|
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...
|
by: Özgür Aytekin |
last post by:
Hello NG
Is DAAB 3.1 the offical replacement of Microsoft Data Access Application
Block 2.0?
DAAB 3.1 download:...
|
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...
|
by: veera sekhar kota |
last post by:
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 me to...
|
by: veera sekhar kota |
last post by:
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 me to...
|
by: Alec MacLean |
last post by:
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...
|
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...
|
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...
|
by: |
last post by:
Hi,
I'm having difficulty connecting my .NET web app to my SQL2000
database via the DAAB. I'm using VS2003 with .NET 1.1.
I'm currently trying names such as Initial Catalog, Data Source, User...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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: 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,...
|
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...
| |