I sincerely apologize for this n00b question.
So today, I installed the Enterprise LIbrary 5.0 on my development machine.
I created a new VS2010 winforms application, set it to .net 4.0.
I set the reference in my project to Microsoft.Practices.EnterpriseLibrary.Common, Data, Unity, and ServiceLocation.
I added a new app.config file to the project. I right-clicked on it in solutions explorer, and chose "Edit Enterprise Library 5.0 Configuration"
I added a data settings application block. In there, there is a database setting for LocalSQLServer that appears in my machine.config that connects to a local instance of MSSQL Express.
In this new database settings section, i add a database instance. I give it a name "MySampleDB", i set the connection string, and chose SQLClient as the provider. I save and exit. I can see the settings in the app.config file that is in my project.In
my Windows Form, I add a button and an on_click event. In that code, I'm doing this:
I compile. There are no errors.
when I step into this, click on the button, an error gets thrown:
Locating source for 'c:\Home\Chris\Projects\CommonServiceLocator\main\Microsoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs'.
(No idea who Chris is, btw. it's not me).
I'm obviously missing something pretty basic but can't figure it out.
I came across this Enterprise Library when trying to find a Data Access Layer framework to avoid having to hand-code common DB functions to an MS SQL 2008 DB using C#.
This Enterprise LIbrary Data Access Application block looks almost like what could be very useful.
I do not understand why I am unable to even get started with that simple line above. If i cannot get connected to the DB, then obviously, the rest of the DAAB cannot execute.
I'm beside myself with frustration in not figuring this out. I do not quite understand why LocalSQLServer is stored in the machine config, along with it's connectionString. It does work.
but what i'm needing to do is specify the connectionstring and DB settings to go along with my applicaiton at an application, not machine level.
I'm REALLY REALLY sorry for being so n00bish. This is my first time with DAAB and the 5.0 library. Looks awesome. but can't get off the ground.
How can I tell the Enterprise LIbrary that i'm using an app.config in my project, not some global machine.config?