EntityFramework connect to Visual Studio SQL Server (localdb) - entity-framework

I am running a local instance of Sql Server through Visual Studio:
It is online and I am able to view the data in the database through the UI.
My App.config file looks like the following:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections>
<connectionStrings>
<add name="EntitiesContext" connectionString="Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=master;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" providerName="System.Data.SqlClient"/>
<add name="DefaultConnection" connectionString="Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=master;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" providerName="System.Data.SqlClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient"
type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup>
</configuration>
And my EntitiesContext looks like the following:
Could someone please help with what I am missing as this keeps failing connection with the following:
System.Data.SqlClient.SqlException: 'A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)'
Inner Exception
Win32Exception: The system cannot find the file specified

The issue is that the connection string you are using is reverting to a named pipe connection, and it's telling you that nothing is listening on that Pipe.
Changing it to "localhost\MSSQLLocalDB;...." should work if your local database is set up for Shared Memory connections.
To check what protocols are enabled on your server you can run MMC.exe then add the plugin for SQL Server Configuration Manager. Under SQL Server Network Configuration it will show whether your SQL Server instance is allowing Named Pipes or TCP/IP. I believe by default SQL Express only enables Shared Memory which is fine for local testing purposes.

Related

Provider error after migrating from SQL Server Compact 4.0 to SQL Server Express

We decided to migrate from SQL Server Compact to SQL Server Express (possibly LocalDB) as Compact is no longer supported and we believe Express is more feature rich and likely performs better.
I made the changes necessary (although clearly missed something :) ) and the database is recreated as an .mdf file. The problem seems to be when the database is accessed. I get the error I have pasted below. The upshot is that somehow, somewhere I seem to have a reference to a provider with invariant name System.Data.SqlServerCe.4.0 when I have no intention of doing so.
I have done research and found these two relevant posts, which are not fully answered:
MVC app erroring on SqlServerCe.4.0 provider after converting to Sql Express
and
Entity Framework using the wrong connection provider
I have tried deleting the migrations and have modified the app.config file. I have also deleted on references to SQL Server Compact from the project references. What else should I be looking at? I'm tearing my hair out over this one.
What other information can I provide?
Thanks,
Dave
P.S. Another way to ask the question would be pointing out that https://stackoverflow.com/users/183934/erikej commented in the links above:
"Obviously you reference sqlce somewhere, either in .settings or in code based configuration DbConfiguration class... – ErikEJ Sep 13 '14 at 6:09 "
Where are all possible places that Compact could be referenced?
Exception thrown: 'System.Data.DataException' in EntityFramework.dll
Exception thrown: 'System.Data.DataException' in mscorlib.dll
The thread 0x2df0 has exited with code 0 (0x0).
05.01.2017 21:50:50: Fatal [line: 18 StartupErrorViewModel -> .ctor()]: System.Data.DataException: An exception occurred while initializing the database. See the InnerException for details.
System.Data.Entity.Core.MetadataException: Schema specified is not valid. >
Errors:
(0,0) : error 0152: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlServerCe.4.0'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Loader.ThrowOnNonWarningErrors()
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Loader.LoadItems(IEnumerable1 xmlReaders, IEnumerable1 sourceFilePaths)
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Loader..ctor(IEnumerable1 xmlReaders, IEnumerable1 sourceFilePaths, Boolean throwOnError, IDbDependencyResolver resolver)
at System.DThe thread 0x6d84 has exited with code 0 (0x0).
ata.Entity.Core.Metadata.Edm.StoreItemCollection.Init(IEnumerable1 xmlReaders, IEnumerable1 filePaths, Boolean throwOnError, IDbDependencyResolver resolver, DbProviderManifest& providerManifest, DbProviderFactory& providerFactory, String& providerInvariantName, String& providerManifestToken, Memoizer2& cachedCTypeFunction)
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection..ctor(IEnumerable1 xmlReaders)
at System.Data.Entity.Utilities.XDocumentExtensions.GetStorageMappingItemCollection(XDocument model, DbProviderInfo& providerInfo)
at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.Diff(XDocument sourceModel, XDocument targetModel, Lazy1 modificationCommandTreeGenerator, MigrationSqlGenerator migrationSqlGenerator, String sourceModelVersion, String targetModelVersion)
at System.Data.Entity.Internal.InternalContext.ModelMatches(VersionedModel model)
at System.Data.Entity.Internal.ModelCompatibilityChecker.CompatibleWithModel(InternalContext internalContext, ModelHashCalculator modelHashCalculator, Boolean throwIfNoMetadata, DatabaseExistenceState existenceState)
at System.Data.Entity.Internal.InternalContext.CompatibleWithModel(Boolean throwIfNoMetadata, DatabaseExistenceState existenceState)
at System.Data.Entity.CreateDatabaseIfNotExists1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf1.<CreateInitializationAction>b__e()
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
--- End of inner exception stack trace ---
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
at System.Data.Entity.Internal.RetryAction1.PerformAction(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action1 action)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet1.GetEnumerator()
at System.Data.Entity.Infrastructure.DbQuery1.System.Collections.Generic.IEnumerable.GetEnumerator()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Med.Vax.DataAccess.Repositories.LocalDbRepository1.GetAll() in C:\MedRepo\vax-box-sw\App\DataAccess\Repositories\LocalDbRepository.cs:line 68
at Med.Vax.App.d__28.MoveNext() in C:\MedRepo\vax-box-sw\App\App\App.xaml.cs:line 198
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task ta'Vax.exe' (CLR v4.0.30319: Vax.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXmlLinq\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXmlLinq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Vax.exe' (CLR v4.0.30319: Vax.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemCore\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemCore.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
sk)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Med.Vax.App.d__30.MoveNext() in C:\MedRepo\vax-box-sw\App\App\App.xaml.cs:line 503
ADDITIONAL INFO BASED ON COMMENTS
There are two app.config files, and perhaps this is part of the problem. One in the main app part, and one in the data access layer. Notice the code that is commented out with <!-- --> I asssume this is perfectly fine to do as these are just xml files?
Here's the one in the main app:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="TruMed.AccuVax.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="LoggingVerbosity" value="Debug" />
<add key="StartMaximized" value="True" />
<add key="AllowMultipleInstances" value="False" />
<add key="ScreenSaverTimeoutSeconds" value="60" />
<add key="TranslationFile" value="Translation\TranslationData.xml" />
<add key="SoftwareUpgradeDirectory" value="C:\TruMed\SoftwareUpgrade" />
<add key="FirmwareUpgradeDirectory" value="C:\TruMed\FirmwareUpgrade" />
<add key="PerformDatabaseMaintenance" value="False" />
<add key="AWSRegion" value="us-west-2"/>
<add key="AWSProfilesLocation" value="C:\TruMed\AccuVax\credentials"/>
</appSettings>
<!--
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
<parameters>
<parameter value="System.Data.SqlServerCe.4.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.4.0" />
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</DbProviderFactories>
</system.data>
-->
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<userSettings>
<TruMed.AccuVax.Properties.Settings>
<setting name="RobotZParkingLocation" serializeAs="String">
<value>0</value>
</setting>
</TruMed.AccuVax.Properties.Settings>
</userSettings>
</configuration>
and here is the one from the data access layer:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<!--
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
<parameters>
<parameter value="System.Data.SqlServerCe.4.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.4.0" />
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</DbProviderFactories>
</system.data>
-->
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
Except for the commented out sections, I do not believe I am mentioning SQL Server Compact!
ADDITIONAL INFO IN RESPONSE TO COMMENTS 2
The configuration string used is pulled from a .json file and looks like this:
LocalDbConnection:
Server=(LocalDB)\\MSSQLLocalDB;Integrated Security=true;Initial Catalog=Vax3
Previously I was using:
Data Source=C:\ProgramData\TruMed\AccuVax\AccuVax.sdf;
Clearly there is some concern I'm using the wrong connection string and/or adapter as I'm getting messages about SQL Server Compact. I have searched the code for AccuVax.sdf and have not found any instances. Again, database is created no problem; the problem seems to be accessing it.
We also had the same problem. We tried to migrate from SQL Compact to SQL Express. We chased and removed any reference to SQL Compact in the solution but that was not enough.
Our final move was to clean completely the solution (any visual studio that are not needed to open the solution):
remove obj, debug, release...
remove .vs folder (that's probably the one)
Finally we reopened the solution, tried again and got it work.
Hope it helps.

Issue with configuring web.config to use sql server database

I playing around with the John Papa's HotTowel application. The HotTowel sample uses local codecamper.sdf database and I am trying to configure it to use the database on a sql server 2008 r2. When I run the application, I am getting an error saying "An exception of type 'System.InvalidOperationException' occurred in Breeze.ContextProvider.EF6.dll but was not handled in user code." The error is occurring in the CodeCamperRepository.cs on the line that says "get {return _contextProvider.Metadata()" code. The inner exception says
The connection string 'CodeCamper' in the application's configuration file does not contain the required providerName attribute."
I have the following code in web.config, but I unsure if it is correct:
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="CodeCamper" connectionString="Data Source=testdb\cmstest; Integrated Security=True; MultipleActiveResultSets=True" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="Data Source=testdb\cmstest; Integrated Security=True; MultipleActiveResultSets=True" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
</configuration>
Are there any other changes I should look at to make HotTowel connect to Sql Server? what is it that breeze doesn't like about the configuration? Appreciate any insight.
thanks Community
np
Just like the inner exception says: you need the providerName attribute. So change your ConnectionStrings section to:
<connectionStrings>
<add name="CodeCamper" connectionString="Data Source=testdb\cmstest; Integrated Security=True; MultipleActiveResultSets=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
Just checking, but do you have the CodeCamper connection reference in your DbContext contstructor?
public CCDbContext()
: base("CodeCamper"){ }

Can not create my DbContext in a Unit test

When I create my TLPContext in a unit test I get an exception at the bottom of this page.
I did this in the unit test:
DbContext context = new TLPContext();
context.Database.CreateIfNotExists();
Is this not the correct approach?
What is wrong with my connection string / provider ?
I have followed this: http://www.thereforesystems.com/turn-on-msdtc-windows-7/
but it did not help after a reboot.
Thats my app.config file in my unit test project:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
<connectionStrings>
<add name="TLPContext" providerName="System.Data.SqlClient" connectionString="Data Source=LISA\SQLEXPRESS;Initial Catalog=TLPTEST;Integrated Security=True;Pooling=False;"/>
</connectionStrings>
</configuration>
That is my DbContext, it should be enough to create the db but not the tables...
public class TLPContext : DbContext
{
}
That is the exception I get:
when I create a TLPContext instance in my unit test SetUp:
Test 'TLP.DataAccess.UnitTests.GenericRepositoryTests.Test' failed: System.Data.ProviderIncompatibleException : An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct.
---- System.Data.ProviderIncompatibleException : Der Anbieter hat keine ProviderManifestToken-Zeichenfolge zurückgegeben.
-------- System.Data.SqlClient.SqlException : MSDTC on server 'LISA\SQLEXPRESS' is unavailable.
at System.Data.Entity.ModelConfiguration.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection)
at System.Data.Entity.ModelConfiguration.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest& providerManifest)
If you wouldn't use a connection string, it would automatically find the database server (it searches for SQLEXPRESS) and create the database based on your project's name.
What you are missing is giving the connection string or its name, which can be achieved by using one of the DbContext's constructor:
TLPContext(string connectionStringOrName) : DbContext(connectionStringOrName) {}
I hope this helps!

EF4 The provider did not return a Provider Manifest Token string

Yes, one more question about Provider manifest token. Unfortunately all previous 22 questions was not useful to solve my problem. I developing simple web application using MVC4 + Code First + Sql Express.
Here is my context descendant:
public class MCQContext : DbContext
{
public MCQContext()
: base("name=ApplicationConnection")
{
}
...............
}
And here - part of web.config related to the problem:
<configuration>
<configSections>
<section name="entityFramework"
type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
requirePermission="false" />
</configSections>
<connectionStrings>
<add name="ApplicationConnection"
connectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="name=ApplicationConnection" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
So, as you can see, correct connection string passed to base of context class (I got the same error if I rename connection string to "MCQContext" and do not pass anything to parent context class).
I have no idea how to fix it. This behavior reproduced if I creating absolutely empty MVC4 application, remove all packages (I prefer manually specify required assemblies and do not use NuGet) and fix references (including reference to sqlserver express).
The problem with your connection string here is:
<add name="TrempimModel"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;
AttachDBFilename=|DataDirectory|aspnetdb.sdf;
User Instance=true"
providerName="System.Data.SqlClient" />
You're basically defining what "server" you're connecting to - but you're not saying what database inside the file to connect to. Also - the file extension for SQL Server Express database files is .mdf (not .sdf - that's SQL Server Compact Edition) - you need to take that into account, too! (was a typo, according to comment by OP).
You need to define an extra database=.... (or Initial Catalog=.....) in your connection string:
<add name="TrempimModel"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;
database=YourDatabaseName;
AttachDBFilename=|DataDirectory|aspnetdb.mdf;
User Instance=true"
providerName="System.Data.SqlClient" />
Then it should work just fine.

ADO.NET requesting existing connection string

I created an ADO.NET object in my WCF service project, but when I try to connect in it I get this error:
No connection string named 'FileEntities' could be found in the
application config file.
Here is my code:
public File GetFile()
{
using (FileEntities ctx = new FileEntities())
{
File aFile = (from f in ctx.Files
where f.ID == 5
select f).FirstOrDefault(); // No connection string named 'FileEntities' could be found in the
application config file.
return aFile;
}
}
Here is the App.Config for my service project:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="FileEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=HOOVERS-PC;initial catalog=Interview_MicahHoover;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
</configuration>
I have tried removing the "name=" prefix in the model.
Ah, the problem was my service project just builds a library. The project that uses the library doesn't have the connection string in it. I added the connection string to that project and it (mostly) works.
Keeping things like this straight is a reason to not break things up into a lot of projects, but the WCF O'Reilly book recommends it.