Resolution of the dependency failed

Topics: Data Access Application Block
Oct 11, 2011 at 4:06 PM

Hi,

      I develop a windows application using Entlib5.0, when my app tried to CreateDatabase the following error occurred:

Resolution of the dependency failed, type = \"Microsoft.Practices.EnterpriseLibrary.Data.Database\", name = \"Springer.ConexaoSQL\".

\r\nException occurred while: while resolving.

\r\nException is: InvalidOperationException - The type Database cannot be constructed. You must configure the container to supply this value.

\r\n-----------------------------------------------

\r\nAt the time of the exception, the container was:

\r\n\r\n  Resolving Microsoft.Practices.EnterpriseLibrary.Data.Database,Springer.ConexaoSQL

\r\n"}

   at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\UnityContainer.cs:line 515
   at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, String name, IEnumerable`1 resolverOverrides) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\UnityContainer.cs:line 485
   at Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\UnityContainer.cs:line 173
   at Microsoft.Practices.Unity.UnityServiceLocator.DoGetInstance(Type serviceType, String key) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\UnityServiceLocator.cs:line 64
   at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key) in c:\Home\Chris\Projects\CommonServiceLocator\main\Microsoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs:line 49

my app.config :

 

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
    </configSections>
    <appSettings>
        <add key="Local" value="c:\\Xml NFe\\" />
        <add key="CultureToUse" value="pt-BR" />
        <add key="ClientSettingsProvider.ServiceUri" value="" />
    </appSettings>
    <dataConfiguration defaultDatabase="Springer.ConexaoSQL" />
    <connectionStrings>
    <add name="Springer.ConexaoSQL" connectionString="Password=xxxxxx;Persist Security Info=True;User ID=pportal;Initial Catalog=xxxxx;Data Source=xxxxxxxxxxxx;Application Name=xxxx" providerName="SQLOLEDB.1;" />
  </connectionStrings>
  <system.web>
    <membership defaultProvider="ClientAuthenticationMembershipProvider">
      <providers>
        <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
      </providers>
    </membership>
    <roleManager defaultProvider="ClientRoleProvider" enabled="true">
      <providers>
        <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
      </providers>
    </roleManager>
  </system.web>
</configuration>

 

What can be?

Thanks

Alex