Software Development

Entity Framework Tracing Provider: Schema specified is not valid

I’ve been trying to get the Tracing and Caching Provider Wrappers for Entity Framework working and I ran in to a small problem. It turned out it was actually a silly RTFM issue, but in case you miss out a step here’s what happens when it is missed.

In the CreateWrappedMetadataWorkspace method in the EntityConnectionWrapperUtils class a MetadataException is thrown that states:

Schema specified is not valid. Errors:
(0,0) : error 0175: The specified store provider cannot be found in the configuration, or is not valid

This happens on the line that reads:

StoreItemCollection sic = new StoreItemCollection(ssdl.Select(c => c.CreateReader()));

[Note: Your Exception Assistant may show it on a different line but the stack trace in the exception itself will report correctly.]

What I had missed was some config changes I’d somehow missed out when I was setting up the provider. The missing config is:

<system.data>
  <DbProviderFactories>
    <add name="EF Caching Data Provider"
         invariant="EFCachingProvider"
         description="Caching Provider Wrapper"
         type="EFCachingProvider.EFCachingProviderFactory, EFCachingProvider, Version=1.0.0.0, Culture=neutral, PublicKeyToken=def642f226e0e59b" />
    <add name="EF Tracing Data Provider"
         invariant="EFTracingProvider"
         description="Tracing Provider Wrapper"
         type="EFTracingProvider.EFTracingProviderFactory, EFTracingProvider, Version=1.0.0.0, Culture=neutral, PublicKeyToken=def642f226e0e59b" />
    <add name="EF Generic Provider Wrapper"
         invariant="EFProviderWrapper"
         description="Generic Provider Wrapper"
         type="EFProviderWrapperToolkit.EFProviderWrapperFactory, EFProviderWrapperToolkit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=def642f226e0e59b" />
  </DbProviderFactories>
</system.data>

4 thoughts on “Entity Framework Tracing Provider: Schema specified is not valid

  1. Hi i have the same problem but i have added this configuration into app.config file but probably into a wrong place. I added it into app.config for the library where i use this providers.

    where exactly must i put this configuration? THX

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s