Skip to content

Commit

Permalink
Add-ins not allowed on VS2017 - so do not build or attempt to install…
Browse files Browse the repository at this point in the history
… our test host add-in.

Ignore generated file in git.
  • Loading branch information
lajones committed Feb 16, 2017
1 parent 17d8096 commit 946b759
Show file tree
Hide file tree
Showing 23 changed files with 68 additions and 90 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -22,6 +22,7 @@ EntityFramework.SqlServerCompact.xml
[Ss]tyle[Cc]op.*
*.csproj.DotSettings
/src/EFTools/EntityDesign/VisualStudio/ItemTemplate/VersionedTemplates/
/src/EFTools/EntityDesignPackage/Commands.vsct
/src/EFTools/setup/EFToolsMsi/Resources/EFToolsStrings.wxl
Index.dat
Storage.dat
Expand Down
50 changes: 42 additions & 8 deletions EFTools.msbuild
Expand Up @@ -12,6 +12,7 @@
<SkipEnvSetup></SkipEnvSetup>
<LogsDir>$(SolutionDir)logs\</LogsDir>
<SkipStrongNamesXml>tools\EFToolsSkipStrongNames.xml</SkipStrongNamesXml>
<IsDev14OrLower Condition="'$(VisualStudioVersion)' == '11.0' OR '$(VisualStudioVersion)' == '12.0' OR '$(VisualStudioVersion)' == '14.0'">True</IsDev14OrLower>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -56,11 +57,13 @@
<Target Name="Clean">
<MSBuild Targets="Clean"
Projects="@(Projects)" />
<MSBuild Targets="Clean"
<MSBuild Condition="'$(IsDev14OrLower)' == 'True'"
Targets="Clean"
Projects="@(TestHostProjects)" />
<MSBuild Targets="Clean"
Projects="$(SolutionDir)\src\EFTools\Setup\GenerateMsiInputs\GenerateMsiInputs.msbuild" />
<MSBuild Targets="Clean"
<MSBuild Condition="'$(IsDev14OrLower)' == 'True'"
Targets="Clean"
Projects="$(SolutionDir)\src\EFTools\Setup\EFToolsMsi\EFToolsMsi.wixproj" />
</Target>

Expand Down Expand Up @@ -90,20 +93,35 @@
</Target>

<Target Name="BuildTestHost">
<MSBuild Targets="Build"
<Message Condition="'$(IsDev14OrLower)' != 'True'"
Text="Visual Studio $(VisualStudioVersion) does not allow add-ins. Skipping building test host."
Importance="High" />

<MSBuild Condition="'$(IsDev14OrLower)' == 'True'"
Targets="Build"
Projects="@(TestHostProjects)"
Properties="Configuration=$(Configuration);$(BuildProperties);BuildPackages=false" />
</Target>

<Target Name="GenerateInstallerInputs" DependsOnTargets="BuildFrameworkPackages">
<MSBuild Targets="GenerateMsiInputs"
<Message Condition="'$(IsDev14OrLower)' != 'True'"
Text="Visual Studio $(VisualStudioVersion) does not use MSI installer. Skipping generating MSI installer inputs."
Importance="High" />

<MSBuild Condition="'$(IsDev14OrLower)' == 'True'"
Targets="GenerateMsiInputs"
Projects="$(SolutionDir)src\EFTools\setup\GenerateMsiInputs\GenerateMsiInputs.msbuild"
BuildInParallel="false"
Properties="Configuration=$(Configuration);$(BuildProperties);BuildPackages=false" />
</Target>

<Target Name="BuildInstaller" DependsOnTargets="GenerateInstallerInputs">
<MSBuild Targets="$(BuildTargets)"
<Message Condition="'$(IsDev14OrLower)' != 'True'"
Text="Visual Studio $(VisualStudioVersion) does not use MSI installer. Skipping building the MSI installer."
Importance="High" />

<MSBuild Condition="'$(IsDev14OrLower)' == 'True'"
Targets="$(BuildTargets)"
Projects="$(SolutionDir)src\EFTools\setup\EFToolsMsi\EFToolsMsi.wixproj"
BuildInParallel="false"
Properties="Configuration=$(Configuration);$(BuildProperties);BuildPackages=false" />
Expand All @@ -123,7 +141,12 @@
<TestHostQuery>$([MSBuild]::GetRegistryValueFromView('$(TestHostPath)', 'DisplayName', null, RegistryView.Registry64, RegistryView.Registry32))</TestHostQuery>
<TestHostInstalled>$(TestHostQuery.StartsWith('VS IDE Test Host for Visual Studio'))</TestHostInstalled>
</PropertyGroup>
<Exec Condition="'$(TestHostInstalled)'!='True'"

<Message Condition="'$(IsDev14OrLower)' != 'True'"
Text="Visual Studio $(VisualStudioVersion) does not allow add-ins. Skipping installing test host."
Importance="High" />

<Exec Condition="'$(IsDev14OrLower)' == 'True' AND '$(TestHostInstalled)' != 'True'"
Command='msiexec /qb /i $(OutputPath)VsIdeTestHost.msi /L*v $(LogsDir)VsIdeTestHost.msi.log' />
</Target>

Expand All @@ -133,11 +156,22 @@
<TestHostUnistallGuid Condition=" '$(VisualStudioVersion)' == '12.0' ">{D39AE4C3-21C4-40DE-9F35-53A83803F8DB}</TestHostUnistallGuid>
<TestHostUnistallGuid Condition=" '$(TestHostUnistallGuid)' == '' ">{6FDF32A2-AC01-477f-A9DF-738BC836EE53}</TestHostUnistallGuid>
</PropertyGroup>
<Exec Command='msiexec /qb /x $(TestHostUnistallGuid) /L*v $(LogsDir)VsIdeTestHost.msi.uninstall.log' />

<Message Condition="'$(IsDev14OrLower)' != 'True'"
Text="Visual Studio $(VisualStudioVersion) does not allow add-ins. Skipping uninstalling test host."
Importance="High" />

<Exec Condition="'$(IsDev14OrLower)' == 'True'"
Command='msiexec /qb /x $(TestHostUnistallGuid) /L*v $(LogsDir)VsIdeTestHost.msi.uninstall.log' />
</Target>

<Target Name="Install" DependsOnTargets="Rebuild">
<Exec Command='msiexec /qb /i $(OutputPath)en\EFTools.msi SKIPENVIRONMENTSETUP="$(SkipEnvSetup)" /L*v $(LogsDir)EFTools.msi.log' />
<Message Condition="'$(IsDev14OrLower)' != 'True'"
Text="Visual Studio $(VisualStudioVersion) does not use MSI installer. Skipping installing the MSI."
Importance="High" />

<Exec Condition="'$(IsDev14OrLower)' == 'True'"
Command='msiexec /qb /i $(OutputPath)en\EFTools.msi SKIPENVIRONMENTSETUP="$(SkipEnvSetup)" /L*v $(LogsDir)EFTools.msi.log' />

<!-- This is included here so that we have the correct .PDBs for the last EFTools _installed_ (not just built) -->
<ItemGroup>
Expand Down
Expand Up @@ -328,7 +328,7 @@ partial class MicrosoftDataEntityDesignSerializationHelperBase

return this.LoadModel(serializationResult, store.DefaultPartition, fileName, schemaResolver, validationController, serializerLocator);
}

/// <summary>
/// Loads a EntityDesignerViewModel instance.
/// </summary>
Expand Down
22 changes: 2 additions & 20 deletions src/EntityFramework.PowerShell/EntityFramework.PowerShell.csproj
Expand Up @@ -80,26 +80,8 @@
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<COMReference Include="EnvDTE">
<Guid>{80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2}</Guid>
<VersionMajor>8</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>False</EmbedInteropTypes>
</COMReference>
<COMReference Include="VSLangProj">
<Guid>{49a1950e-3e35-4595-8cb9-920c64c44d67}</Guid>
<VersionMajor>7</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>False</EmbedInteropTypes>
</COMReference>
<Reference Include="EnvDTE" />
<Reference Include="VsLangProj" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\EntityFramework\Properties\Resources.PowerShell.cs">
Expand Down
2 changes: 0 additions & 2 deletions src/EntityFramework/Core/Common/EntitySql/SemanticAnalyzer.cs
Expand Up @@ -3968,7 +3968,6 @@ private static DbExpressionBinding ProcessGroupByClause(DbExpressionBinding sour
if (null != queryExpr.HavingClause
&& queryExpr.HavingClause.HasMethodCall)
{
// LAJ LAJ - needed for side-effects?
ConvertValueExpression(queryExpr.HavingClause.HavingPredicate, sr);
}

Expand Down Expand Up @@ -4046,7 +4045,6 @@ private static DbExpressionBinding ProcessGroupByClause(DbExpressionBinding sour

sr.CurrentScopeRegion.WasResolutionCorrelated = false;

// LAJ LAJ - needed for side-effects?
ConvertValueExpression(orderItem.OrderExpr, sr);

//
Expand Down
14 changes: 7 additions & 7 deletions src/EntityFramework/Core/EntityKey.cs
Expand Up @@ -1219,26 +1219,26 @@ internal void ValidateEntityKey(MetadataWorkspace workspace, EntitySet entitySet
// based on whether the key is a singleton, composite, or temporary.
// </summary>
// <param name="isTemporary"> whether we expect this EntityKey to be marked temporary </param>
[SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Only used in debug mode.")]
[Conditional("DEBUG")]
private void AssertCorrectState(EntitySetBase entitySet, bool isTemporary)
private void AssertCorrectState(EntitySetBase entitySetBase, bool isTemporary)
{
var entitySet = (EntitySet)entitySetBase;
if (_singletonKeyValue != null)
{
Debug.Assert(!isTemporary);
Debug.Assert(_compositeKeyValues == null);
if (entitySet != null)
if (entitySetBase != null)
{
Debug.Assert(((EntitySet)entitySet).ElementType.KeyMembers.Count == 1);
Debug.Assert(entitySet.ElementType.KeyMembers.Count == 1);
}
}
else if (_compositeKeyValues != null)
{
Debug.Assert(!isTemporary);
if (entitySet != null)
if (entitySetBase != null)
{
Debug.Assert(((EntitySet)entitySet).ElementType.KeyMembers.Count > 1);
Debug.Assert(((EntitySet)entitySet).ElementType.KeyMembers.Count == _compositeKeyValues.Length);
Debug.Assert(entitySet.ElementType.KeyMembers.Count > 1);
Debug.Assert(entitySet.ElementType.KeyMembers.Count == _compositeKeyValues.Length);
}
for (var i = 0; i < _compositeKeyValues.Length; ++i)
{
Expand Down
Expand Up @@ -821,7 +821,6 @@ private static void ValidateEnumTypeMapping(EnumType edmEnumType, EnumType objec
var objectComplexType = (ComplexType)containingClrMember.TypeUsage.EdmType;

// Get the type mapping for the complex type
// LAJ LAJ - needed for side-effects?
LoadTypeMapping(edmComplexType, objectComplexType, ocItemCollection, typeMappings);

//Go through the CDMMembers and find the corresponding member in Object space
Expand Down
Expand Up @@ -541,10 +541,8 @@ private static DbExpression GeneratePredicate(ConditionPropertyMapping condition
}
}

[SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Only casts twice in debug mode.")]
private static DbExpression GeneratePropertyMappingView(PropertyMapping mapping, DbExpression row)
{
Debug.Assert(mapping is ScalarPropertyMapping, "Complex property mapping is not supported in function imports.");
var scalarPropertyMapping = (ScalarPropertyMapping)mapping;
return GenerateScalarPropertyMappingView(scalarPropertyMapping.Property, scalarPropertyMapping.Column, row);
}
Expand Down
Expand Up @@ -829,7 +829,6 @@ internal override bool TryGetMap(GlobalItem item, out MappingBase map)
// name="interestingMembersKind" />
// ).
// </returns>
[SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Only casts twice in debug mode.")]
private ReadOnlyCollection<EdmMember> FindInterestingMembers(
EntitySetBase entitySet, EntityTypeBase entityType, InterestingMembersKind interestingMembersKind)
{
Expand All @@ -849,8 +848,6 @@ internal override bool TryGetMap(GlobalItem item, out MappingBase map)
}
else
{
Debug.Assert(storageTypeMapping is EntityTypeMapping, "EntityTypeMapping expected.");

FindInterestingEntityMappingMembers(
(EntityTypeMapping)storageTypeMapping, interestingMembersKind, interestingMembers);
}
Expand Down
Expand Up @@ -157,7 +157,6 @@ internal ViewCellRelation CreateViewCellRelation(int cellNumber)
return m_viewCellRelation;
}

[Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Only cast twice in debug mode.")]
private void GenerateCellRelations(int cellNumber)
{
// Generate the view cell relation
Expand All @@ -173,10 +172,6 @@ private void GenerateCellRelations(int cellNumber)
Debug.Assert(cSlot != null, "Has cell query been normalized?");
Debug.Assert(sSlot != null, "Has cell query been normalized?");

// These slots better be MemberProjectedSlots. We do not have constants etc at this point.
Debug.Assert(cSlot is MemberProjectedSlot, "cSlot is expected to be MemberProjectedSlot");
Debug.Assert(sSlot is MemberProjectedSlot, "sSlot is expected to be MemberProjectedSlot");

var cJoinSlot = (MemberProjectedSlot)cSlot;
var sJoinSlot = (MemberProjectedSlot)sSlot;

Expand Down
6 changes: 0 additions & 6 deletions src/EntityFramework/Core/Metadata/Edm/MslXmlSchemaWriter.cs
Expand Up @@ -268,7 +268,6 @@ private void WriteFunctionImportMappingStartElement(FunctionImportMapping functi
functionImportMapping.FunctionImport.Name);
}

[Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Only cast twice in debug mode.")]
private void WriteFunctionImportResultMappingElement(FunctionImportResultMapping resultMapping)
{
DebugCheck.NotNull(resultMapping);
Expand All @@ -283,8 +282,6 @@ private void WriteFunctionImportResultMappingElement(FunctionImportResultMapping
}
else
{
Debug.Assert(typeMapping is FunctionImportComplexTypeMapping, "Unexpected mapping kind.");

WriteFunctionImportComplexTypeMappingElement((FunctionImportComplexTypeMapping)typeMapping);
}
}
Expand Down Expand Up @@ -346,7 +343,6 @@ private void WriteFunctionImportPropertyMappingElements(IEnumerable<FunctionImpo
}
}

[Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Only cast twice in debug mode.")]
private void WriteFunctionImportConditionElement(FunctionImportEntityTypeMappingCondition condition)
{
DebugCheck.NotNull(condition);
Expand All @@ -360,8 +356,6 @@ private void WriteFunctionImportConditionElement(FunctionImportEntityTypeMapping
}
else
{
Debug.Assert(condition is FunctionImportEntityTypeMappingConditionValue, "Unexpected condition type");

WriteConditionValue(((FunctionImportEntityTypeMappingConditionValue)condition).Value);
}

Expand Down
1 change: 0 additions & 1 deletion src/EntityFramework/Core/Objects/ELinq/Translator.cs
Expand Up @@ -419,7 +419,6 @@ private static bool TryGetTranslator(PropertyInfo propertyInfo, out PropertyTran
if (BuiltInTypeKind.CollectionType
== propertyExpression.ResultType.EdmType.BuiltInTypeKind)
{
Debug.Assert(clrMember is PropertyInfo, "Navigation property was not a property; should not be allowed by metadata.");
var propertyType = ((PropertyInfo)clrMember).PropertyType;
if (propertyType.IsGenericType()
&& propertyType.GetGenericTypeDefinition() == typeof(EntityCollection<>))
Expand Down
5 changes: 0 additions & 5 deletions src/EntityFramework/Core/Objects/EntityEntry.cs
Expand Up @@ -2165,10 +2165,8 @@ internal void UpdateComplexObjectSnapshot(StateManagerMemberMetadata member, obj
// they will ultimately be brought into the context as Added objects, at which point we would
// have skipped them anyway because the are not Unchanged or Modified.
// </summary>
[SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Only cast twice in debug mode.")]
internal void FixupFKValuesFromNonAddedReferences()
{
Debug.Assert(EntitySet is EntitySet, "Expect entity entries to have true entity sets.");
if (!((EntitySet)EntitySet).HasForeignKeyRelationships)
{
return;
Expand All @@ -2192,9 +2190,6 @@ internal void FixupFKValuesFromNonAddedReferences()
if (_cache.TryGetObjectStateEntry(principal, out principalEntry)
&& (principalEntry.State == EntityState.Modified || principalEntry.State == EntityState.Unchanged))
{
Debug.Assert(
principalEntry is EntityEntry,
"Existing entry for an entity must be an EntityEntry, not a RelationshipEntry");
reference.UpdateForeignKeyValues(
WrappedEntity, ((EntityEntry)principalEntry).WrappedEntity, changedFKs, forceChange: false);
}
Expand Down
Expand Up @@ -526,11 +526,8 @@ private static Action<object> GetResetFKSetterFlagDelegate(Func<object, object>
// an obejct becayse IEntityWrapper is an internal type and is therefore not accessable to
// the proxy type. Once we're in the framework it is cast back to an IEntityWrapper.
// </summary>
[SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Only cast twice in debug mode.")]
private static void ResetFKSetterFlag(object wrappedEntityAsObject)
{
Debug.Assert(
wrappedEntityAsObject == null || wrappedEntityAsObject is IEntityWrapper, "wrappedEntityAsObject must be an IEntityWrapper");
var wrappedEntity = (IEntityWrapper)wrappedEntityAsObject; // We want an exception if the cast fails.
if (wrappedEntity != null
&& wrappedEntity.Context != null)
Expand Down
2 changes: 0 additions & 2 deletions src/EntityFramework/Core/Objects/Internal/LazyLoadBehavior.cs
Expand Up @@ -129,7 +129,6 @@ internal static bool IsLazyLoadCandidate(EntityType ospaceEntityType, EdmMember
// </param>
// <param name="wrapperObject"> Entity wrapper object used to retrieve RelationshipManager for the proxied entity. </param>
// <returns> True if the value instance was mutated and can be returned False if the class should refetch the value because the instance has changed </returns>
[SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Only cast twice in debug mode.")]
private static bool LoadProperty<TItem>(
TItem propertyValue, string relationshipName, string targetRoleName, bool mustBeNull, object wrapperObject) where TItem : class
{
Expand All @@ -140,7 +139,6 @@ internal static bool IsLazyLoadCandidate(EntityType ospaceEntityType, EdmMember
// 3. A non-null RelationshipManager can be retrieved (this is asserted).
// 4. The EntityCollection is not already loaded.

Debug.Assert(wrapperObject == null || wrapperObject is IEntityWrapper, "wrapperObject must be an IEntityWrapper");
var wrapper = (IEntityWrapper)wrapperObject; // We want an exception if the cast fails.

if (wrapper != null
Expand Down
3 changes: 0 additions & 3 deletions src/EntityFramework/Core/Objects/ObjectStateManager.cs
Expand Up @@ -776,7 +776,6 @@ internal virtual void DegradePromotedRelationships()
// <param name="setIsLoaded"> Tells whether we should allow the IsLoaded flag to be set to true for RelatedEnds </param>
// <param name="relationshipAlreadyExists"> Whether or not the relationship entry already exists in the cache for these entities </param>
// <param name="inKeyEntryPromotion"> Whether this method is used in key entry promotion </param>
[SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Justification = "Only cast twice in debug mode.")]
internal static void AddEntityToCollectionOrReference(
MergeOption mergeOption,
IEntityWrapper wrappedSource,
Expand All @@ -794,8 +793,6 @@ internal virtual void DegradePromotedRelationships()
if (targetMember.RelationshipMultiplicity
!= RelationshipMultiplicity.Many)
{
Debug.Assert(
relatedEnd is EntityReference, "If end is not Many multiplicity, then the RelatedEnd should be an EntityReference.");
var relatedReference = (EntityReference)relatedEnd;

switch (mergeOption)
Expand Down

0 comments on commit 946b759

Please sign in to comment.