Find file
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (25 sloc) 1.4 KB


AppHarbify.Tools is a collection of small nuget packages that help make your software deployable to AppHarbor by AppHarbify.


A common pattern with EF is to define your DataContext like so.

public class FooContext : DbContext {  
    public FooContext() : base ("Foo")  

Which then, by convention, picks up a connection string named Foo.

This doesn't work very well for AppHarbify as by default on AppHarbor, the connection string lives in an AppSetting called SQLSERVER_CONNECTION_STRING.

AppHarbify.EF makes it really simple to override this convention when it detects the AppSetting, leaving it alone when it does not, so that with a single line of code you can support running on AppHarbor with no setup.

First install the package Install-Package AppHarbify.EF
Then add the following line of code somewhere in your app startup process.


You can also enable MultipleActiveResultSets by simply passing in true, which will append MultipleActiveResultSets=True; to the connection string provided by AppHarbor.


See Also