Fix for 2087: TPT different name for the PK columns ignored when DbSet for derived type is included

The fix is multifaceted as there are multiple issues with derived type configurations:
  Configuration object assigned to property when it's being configured will be cloned so that when its mutated other properties wont be affected
  Configuration for inherited properties will not be removed whether the base type is discovered first or not
  When discovering properties all ancestor type configurations will also be checked for ignored properties
  When removing duplicate TPH column configurations they will be merged in S-Space instead of C-Space
  PrimitivePropertyConfiguration will only configure IsNullable, ConcurrencyMode and DatabaseGeneratedOption in C-Space
  Custom annotations configuration will only be merged in S-Space
  BinaryPropertyConfiguration will only configure ColumnType in S-Space
Hybrid technology requires more gas... (2254: TPT/TPH hybrid generates database, but derived properties are not nullable)

The default configuration is TPH and columns coming from properties in derived types are made nullable. When mapping switches to TPT the nullability of these columns is reset. But if the mapping is actually hybrid with TPT at the base and then TPH below it then the nullability of some columns should not be reset.

Note that there is a fairly good chance that this change will cause a perf hit for model building with large models containing inheritance. We should investigate/profile as necessary.
"Threads are easy" said no one, ever - Fix for #2429
Test KeyProperties_is_thread_safe failed while running a build in a development machine. Assert.True(keys != null) failed because the getter to KeyProperties would allow for a change of value in the _keyProperties member between the check for nullity and the return instruction. This is solved by copying the value of _keyProperties to a local variable before checking for nullity and using it as the return value.
Additionally, there was a second concurrency problem which would manifest as a failure in the Assert.False(ReferenceEquals(keys, keysAfterReset)). It was caused by the event subscription model used. The KeyProperties getter, when _keyProperties is null, first creates the instance and then registers an event handler onto KeyMembers.SourceAccessed. When KeyMembers.Source is touched, it calls the handler which in turn tries to clear the value of _keyProperties to null and then unregisters the event handler of KeyMembers.SourceAccessed. The issue was solved by inverting the order of the instructions in the KeyProperties getter to first set the event handler and then initialize the value of _keyProperties.
Note that in my development machine the test always passed when executed, and so far it hasn't failed in the CI environment either. That said, before this change the test would fail consistently when executed under a debugger, which presumably changes the concurrency characteristics of the environment.
Issue 2264. Separated out the part of EFToolsMsi.wixproj which pulls out all the runtime dependencies into a separate .msbuild file so that it can be overridden for Servicing.
Hey Mom, that's my stuff! (2418: ObjectContext.ExecuteStoreQueryInternal disposes DbCommand too early)

In previous versions of EF the command was not disposed at all. See https://entityframework.codeplex.com/workitem/2306 for more info. In EF6 we started disposing the commands immediately, which is wrong because the command should not be disposed until after the reader is disposed. The easiest fix would be to revert to the EF5 behavior. In this case I chose to instead keep disposing but only when the returned ObjectResult is disposed. This seems like the least change in EF6 functionality that fixes the issue.
Referencing correct .csproj to include src files in symbols package
Adds constructor of MigrateDatabaseToLatestVersion with migrations configuration parameter.
Adds tests of the new MigrationDatabaseToLatestVersion constructor.
Issue 2390 - when cloning DbCommand cloning the DesignTimeVisible property
can lead to deadlocks. So here allow providers to override how cloning a
DbCommand works and use this in SqlProviderServices to avoid the issue
that caused a deadlock.
Fix for EFTools in Visual Studio 14 CTP3: DpiHelperClass was moved to Microsoft.VisualStudio.Utilities for Dev14 so adding this reference conditionally. Also temporarily removing rule CA1809 from Code Analysis to be able to compile VirtualTreeControl with Dev14.
Reducing CPU to save polar bears - Fix for #2446

The amount of work done in order to build models has been reduced by:
  - Temporarily caching (in the stack) data structures that were not changing. See SyncNullabilityCSSpace().
  - Using direct iterators instead of enumerators in the hot path when the structures permit it.
  - Reducing the use of Linq and lambdas in the hot path in order to avoid unnecessary allocations and closures.
  - Calling ToList() instead of ToArray() when possible in order to avoid unnecessary allocations.
  - Eliminating the use of foreach enumerators with calls to .Reverse(). Instead using a direct decrement iterator.
  - Caching of property values that used to be computed when the getter was called. The cache also has an expiration policy related to the mutability of the data and the lifespan of the instance that references it.

The test that exposed this regression showed an 18% setback after changeset 604533a309d7 was committed. This fix not only puts model building back on baseline, but it made it 15% faster than it was before this regression.

All tests passing.
Schrödinger's Granny (2435: Stop IsPropertyChanged from throwing for change tracking entities)

The IsPropertyChanged API was added in .NET 4.5. The intention of this API is to check whether a property's current value is different from its original value. This may be different from the actual modified state of the property for properties that have been explicitly set as modified or where the property was changed but then changed back.

The problem is that for change tracking proxies and entities that derive from EntityObject there is no way of knowing this information because original values are not tracked for this type of entity. Therefore the best we can do is return whether or not the property is marked as modified, which is what we now do. We could throw instead, but for most usages the modified state is sufficient and hence seems like the more useful behavior.
Build: Update $(ProgramFiles)\MSBuild to $(MSBuildExtensionsPath32)

Work Item: 2472
WhoIsAboutToMoveMyExportProvider: Taking a preemptive move to dodge an upcoming breaking change in VS 14 CTP4: they are replacing Visual Studio's MEF hosting with a VS-specific implementation. As part of this change they are disabling IComponentModel.DefaultCatalog and changing the recommended way to obtain a MEF ExportProvider to IComponentModel.DefaultExportProvider, and API that existed before. We were using IComponentModel.DefaultCatalog just to obtain the latter so I am simply changing our code to use IComponentModel.DefaultExportProvider in all versions.
Adding errors from memory-optimized tables to SqlAzureExecutionStrategy.

Workitem: 2458
Making WithCurrentCulture public and making it store the UI culture too.

Workitem: 2425
Penny the pig is mad. Hubert is mad too. Trent does not care.
Careful! Don't fall into the stream... (2468: DatabaseLogger throws System.ArgumentOutOfRangeException)

DatabaseLogger has a mode where it writes to a file using a StreamWriter. This can be used by multiple threads concurrently, but the StreamWriter is not thread safe. This change locks while doing the writes to prevent concurrency issues.
Foot in the door... (2447: Need a public method in DbModelBuilder)

This change creates a public non-generic method for registering entity types on DbModelBuilder. It does not allow further configuration of the entity type since this would require quite extensive changes to the fluent API surface which is heavily based on generics. However, these is still some value to this method because it is not uncommon to want to register types dynamically and then have the model configured by conventions--for example, this is what DbContext does by default. EF7 will allow full configuration without using generics.

I gave this method a different name than the current internal method since I know a fair amount of code already accesses that method using Reflection. The return type of the public method is void and both making the internal method public and changing its return type could cause Reflection code to break.
Bug 952621: DTS: EF creates unnecessary joins when using derived types.

When the PreProcessor encounters a navigation PropertyOp it rewrites the corresponding node into one that represents a query. The query is then added as nested subquery to the first RelOp ancestor. When the RelOp nodes are processed, the SubqueryTrackingVisitor creates a chain of outer applies: if S1, S2, ... are the subqueries and D the original (driver) input, the output created looks like OuterApply(OuterApply(D, S1), S2), ... Later in the plan compiler, when the transformations are run, the outer applies are transformed into left outer joins. If a Linq query projects multiple properties of an object accessed via a navigation property (x.NavProp.P1, x.NavProp.P2, ...) the final query ends having duplicated joins. The JoinElimination phase tries to eliminated duplicates but does not cover complex cases.

Instead of attempting to enhance the JoinElimination phase further, and make that code even more complex, the fix eliminates the duplicate subqueries early, in the PreProcessor, by caching and reusing the rewritten nodes. The logic for cache hits is implemented in the NavigationPropertyOpInfo class. Basically two navigation property nodes are considered equivalent from the cache point of view if they have the same RelOp ancestor (not null), same navigation property (EdmMember) and the subtrees having them as root are equivalent. For fast retrieval GetHashCode computes a hash code using the RelOp ancestor's hash code, the navigation property's hash code and the node's computed hash value.