在我们的 VStudio 2015 解决方案中,我们有一系列 SSDT。其中之一是返回异常 ““SqlBuildTask”任务意外失败。Microsoft.Data.Tools.Schema.Sql.Build.BuildFailedException:具有相同键的条目已经存在。” 。我进入了 Microsoft.Data.Tools.Schema.SqlTasks.targets 并查看了(在下面发布)
<SqlBuildTask PostdeployItem="@(PostDeploy->'%(FullPath)')"
PredeployItem="@(PreDeploy->'%(FullPath)')"
RefactorLog="@(RefactorLog->'%(FullPath)')"
SqlTarget="@(SqlTarget)"
ContributorArguments="$(ContributorArguments)"
BuildExtensionConfiguration="@(BuildExtensionConfiguration)"
BuildContributors="$(BuildContributors)"
DeploymentExtensionConfiguration="@(DeploymentExtensionConfiguration)"
DeploymentContributors="$(DeploymentContributors)"
ConnectionString="$(TargetConnectionString)"
CreateScriptFileName="$(CreateScriptFileName)"
DacApplicationName="$(DacApplicationName)"
DacDescription="$(DacDescription)"
DacFile="@(DacFile)"
DacVersion="$(DacVersion)"
DatabaseName="$(TargetDatabase)"
DatabaseSchemaProviderName="$(DSP)"
DefaultSchema="$(DefaultSchema)"
DeploymentScriptName="$(DeployScriptFileName)"
DeployToDatabase="$(UpdateDatabase)"
GenerateCreateScript="$(GenerateCreateScript)"
GenerateDac="$(GenerateDac)"
ImplicitDllAssemblyName="$(AssemblyName)"
ImplicitDllAssemblyOwner="$(AssemblyOwner)"
ImplicitDllFileName="$(IntermediateTargetFullFileName)"
ImplicitDllSymbolsFileName="$(IntermediateSymbolsFullFileName)"
ImplicitDllGenerateSqlClrDdl="$(GenerateSqlClrDdl)"
ImplicitDllIsVisible="$(IsVisible)"
ImplicitDllPermissionSet="$(PermissionSet)"
IntermediateDirectory="$(GeneratedFilesIntermediatePath)"
ModelCollation="$(ModelCollation)"
OutputDirectory="$(TargetDir)"
PreserveHeaderComments="$(PreserveHeaderComments)"
Source="@(Build->'%(FullPath)')"
SqlCmdVariables="@(SqlCmdVariables)"
SqlReferencePath="@(SqlReferencePath)"
SuppressTSqlWarnings="$(SuppressTSqlWarnings)"
TreatTSqlWarningsAsErrors="$(TreatTSqlWarningsAsErrors)"
ValidateCasingOnIdentifiers="$(ValidateCasingOnIdentifiers)"
CmdLineInMemoryStorage="$(CmdLineInMemoryStorage)"
DefaultCollation="$(DefaultCollation)"
AnsiNullDefault="$(AnsiNullDefault)"
AnsiNulls="$(AnsiNulls)"
AnsiPadding="$(AnsiPadding)"
AnsiWarnings="$(AnsiWarnings)"
ArithAbort="$(ArithAbort)"
ConcatNullYieldsNull="$(ConcatNullYieldsNull)"
QuotedIdentifier="$(QuotedIdentifier)"
NumericRoundAbort="$(NumericRoundAbort)"
RecursiveTriggersEnabled="$(RecursiveTriggersEnabled)"
DatabaseChaining="$(DatabaseChaining)"
DatabaseState="$(DatabaseState)"
UpdateOptions="$(UpdateOptions)"
CloseCursorOnCommitEnabled="$(CloseCursorOnCommitEnabled)"
DefaultCursor="$(DefaultCursor)"
AutoClose="$(AutoClose)"
AutoCreateStatistics="$(AutoCreateStatistics)"
AutoShrink="$(AutoShrink)"
AutoUpdateStatistics="$(AutoUpdateStatistics)"
TornPageDetection="$(TornPageDetection)"
DatabaseAccess="$(DatabaseAccess)"
Recovery="$(Recovery)"
EnableFullTextSearch="$(EnableFullTextSearch)"
DefaultFilegroup="$(DefaultFilegroup)"
Trustworthy="$(Trustworthy)"
AutoUpdateStatisticsAsynchronously="$(AutoUpdateStatisticsAsynchronously)"
PageVerify="$(PageVerify)"
ServiceBrokerOption="$(ServiceBrokerOption)"
DateCorrelationOptimizationOn="$(DateCorrelationOptimizationOn)"
Parameterization="$(Parameterization)"
AllowSnapshotIsolation="$(AllowSnapshotIsolation)"
ReadCommittedSnapshot="$(ReadCommittedSnapshot)"
VardecimalStorageFormatOn="$(VardecimalStorageFormatOn)"
SupplementalLoggingOn="$(SupplementalLoggingOn)"
CompatibilityMode="$(CompatibilityMode)"
DefaultFileStreamFilegroup="$(DefaultFileStreamFilegroup)"
IsChangeTrackingOn="$(IsChangeTrackingOn)"
IsChangeTrackingAutoCleanupOn="$(IsChangeTrackingAutoCleanupOn)"
ChangeTrackingRetentionPeriod="$(ChangeTrackingRetentionPeriod)"
ChangeTrackingRetentionUnit="$(ChangeTrackingRetentionUnit)"
IsEncryptionOn="$(IsEncryptionOn)"
IsBrokerPriorityHonored="$(IsBrokerPriorityHonored)"
Containment="$(Containment)"
DatabaseDefaultLanguage="$(DatabaseDefaultLanguage)"
DatabaseDefaultFulltextLanguage="$(DatabaseDefaultFulltextLanguage)"
IsNestedTriggersOn="$(IsNestedTriggersOn)"
IsTransformNoiseWordsOn="$(IsTransformNoiseWordsOn)"
TwoDigitYearCutoff="$(TwoDigitYearCutoff)"
NonTransactedFileStreamAccess="$(NonTransactedFileStreamAccess)"
FileStreamDirectoryName="$(FileStreamDirectoryName)"
TargetRecoveryTimePeriod="$(TargetRecoveryTimePeriod)"
TargetRecoveryTimeUnit="$(TargetRecoveryTimeUnit)"
DelayedDurability="$(DelayedDurability)"
AutoCreateStatisticsIncremental="$(AutoCreateStatisticsIncremental)"
MemoryOptimizedElevateToSnapshot="$(MemoryOptimizedElevateToSnapshot)"
QueryStoreCaptureMode="$(QueryStoreCaptureMode)"
QueryStoreDesiredState="$(QueryStoreDesiredState)"
QueryStoreFlushInterval="$(QueryStoreFlushInterval)"
QueryStoreStatsInterval="$(QueryStoreStatsInterval)"
QueryStoreMaxPlansPerQuery="$(QueryStoreMaxPlansPerQuery)"
QueryStoreStaleQueryThreshold="$(QueryStoreStaleQueryThreshold)"
QueryStoreMaxStorageSize="$(QueryStoreMaxStorageSize)"
DbScopedConfigLegacyCardinalityEstimation="$(DbScopedConfigLegacyCardinalityEstimation)"
DbScopedConfigLegacyCardinalityEstimationSecondary="$(DbScopedConfigLegacyCardinalityEstimationSecondary)"
DbScopedConfigMaxDOP="$(DbScopedConfigMaxDOP)"
DbScopedConfigMaxDOPSecondary="$(DbScopedConfigMaxDOPSecondary)"
DbScopedConfigParameterSniffing="$(DbScopedConfigParameterSniffing)"
DbScopedConfigParameterSniffingSecondary="$(DbScopedConfigParameterSniffingSecondary)"
DbScopedConfigOptimizerHotfixes="$(DbScopedConfigOptimizerHotfixes)"
DbScopedConfigOptimizerHotfixesSecondary="$(DbScopedConfigOptimizerHotfixesSecondary)"
TemporalHistoryRetentionEnabled="$(TemporalHistoryRetentionEnabled)"
AdditionalDeploymentContributorArguments="$(AdditionalDeploymentContributorArguments)"
AdditionalDeploymentContributors="$(AdditionalDeploymentContributors)"
AllowDropBlockingAssemblies="$(AllowDropBlockingAssemblies)"
AllowIncompatiblePlatform="$(AllowIncompatiblePlatform)"
AllowUnsafeRowLevelSecurityDataMovement="$(AllowUnsafeRowLevelSecurityDataMovement)"
BackupDatabaseBeforeChanges="$(BackupDatabaseBeforeChanges)"
BlockOnPossibleDataLoss="$(BlockOnPossibleDataLoss)"
BlockWhenDriftDetected="$(BlockWhenDriftDetected)"
CommentOutSetVarDeclarations="$(CommentOutSetVarDeclarations)"
CompareUsingTargetCollation="$(CompareUsingTargetCollation)"
CreateNewDatabase="$(CreateNewDatabase)"
DeployDatabaseInSingleUserMode="$(DeployDatabaseInSingleUserMode)"
DisableAndReenableDdlTriggers="$(DisableAndReenableDdlTriggers)"
DoNotAlterChangeDataCaptureObjects="$(DoNotAlterChangeDataCaptureObjects)"
DoNotAlterReplicatedObjects="$(DoNotAlterReplicatedObjects)"
DoNotDropAggregates="$(DoNotDropAggregates)"
DoNotDropApplicationRoles="$(DoNotDropApplicationRoles)"
DoNotDropAssemblies="$(DoNotDropAssemblies)"
DoNotDropAsymmetricKeys="$(DoNotDropAsymmetricKeys)"
DoNotDropAudits="$(DoNotDropAudits)"
DoNotDropBrokerPriorities="$(DoNotDropBrokerPriorities)"
DoNotDropCertificates="$(DoNotDropCertificates)"
DoNotDropClrUserDefinedTypes="$(DoNotDropClrUserDefinedTypes)"
DoNotDropColumnEncryptionKeys="$(DoNotDropColumnEncryptionKeys)"
DoNotDropColumnMasterKeys="$(DoNotDropColumnMasterKeys)"
DoNotDropContracts="$(DoNotDropContracts)"
DoNotDropCredentials="$(DoNotDropCredentials)"
DoNotDropCryptographicProviders="$(DoNotDropCryptographicProviders)"
DoNotDropDatabaseAuditSpecifications="$(DoNotDropDatabaseAuditSpecifications)"
DoNotDropDatabaseRoles="$(DoNotDropDatabaseRoles)"
DoNotDropDatabaseScopedCredentials="$(DoNotDropDatabaseScopedCredentials)"
DoNotDropDatabaseTriggers="$(DoNotDropDatabaseTriggers)"
DoNotDropDefaults="$(DoNotDropDefaults)"
DoNotDropEndpoints="$(DoNotDropEndpoints)"
DoNotDropErrorMessages="$(DoNotDropErrorMessages)"
DoNotDropEventNotifications="$(DoNotDropEventNotifications)"
DoNotDropEventSessions="$(DoNotDropEventSessions)"
DoNotDropExtendedProperties="$(DoNotDropExtendedProperties)"
DoNotDropExternalDataSources="$(DoNotDropExternalDataSources)"
DoNotDropExternalFileFormats="$(DoNotDropExternalFileFormats)"
DoNotDropExternalTables="$(DoNotDropExternalTables)"
DoNotDropFilegroups="$(DoNotDropFilegroups)"
DoNotDropFileTables="$(DoNotDropFileTables)"
DoNotDropFullTextCatalogs="$(DoNotDropFullTextCatalogs)"
DoNotDropFullTextStoplists="$(DoNotDropFullTextStoplists)"
DoNotDropLinkedServerLogins="$(DoNotDropLinkedServerLogins)"
DoNotDropLinkedServers="$(DoNotDropLinkedServers)"
DoNotDropLogins="$(DoNotDropLogins)"
DoNotDropMessageTypes="$(DoNotDropMessageTypes)"
DoNotDropPartitionFunctions="$(DoNotDropPartitionFunctions)"
DoNotDropPartitionSchemes="$(DoNotDropPartitionSchemes)"
DoNotDropPermissions="$(DoNotDropPermissions)"
DoNotDropQueues="$(DoNotDropQueues)"
DoNotDropRemoteServiceBindings="$(DoNotDropRemoteServiceBindings)"
DoNotDropRoleMembership="$(DoNotDropRoleMembership)"
DoNotDropRoutes="$(DoNotDropRoutes)"
DoNotDropRules="$(DoNotDropRules)"
DoNotDropScalarValuedFunctions="$(DoNotDropScalarValuedFunctions)"
DoNotDropSearchPropertyLists="$(DoNotDropSearchPropertyLists)"
DoNotDropSecurityPolicies="$(DoNotDropSecurityPolicies)"
DoNotDropSequences="$(DoNotDropSequences)"
DoNotDropServerAuditSpecifications="$(DoNotDropServerAuditSpecifications)"
DoNotDropServerRoleMembership="$(DoNotDropServerRoleMembership)"
DoNotDropServerRoles="$(DoNotDropServerRoles)"
DoNotDropServerTriggers="$(DoNotDropServerTriggers)"
DoNotDropServices="$(DoNotDropServices)"
DoNotDropSignatures="$(DoNotDropSignatures)"
DoNotDropStoredProcedures="$(DoNotDropStoredProcedures)"
DoNotDropSymmetricKeys="$(DoNotDropSymmetricKeys)"
DoNotDropSynonyms="$(DoNotDropSynonyms)"
DoNotDropTables="$(DoNotDropTables)"
DoNotDropTableValuedFunctions="$(DoNotDropTableValuedFunctions)"
DoNotDropUserDefinedDataTypes="$(DoNotDropUserDefinedDataTypes)"
DoNotDropUserDefinedTableTypes="$(DoNotDropUserDefinedTableTypes)"
DoNotDropUsers="$(DoNotDropUsers)"
DoNotDropViews="$(DoNotDropViews)"
DoNotDropXmlSchemaCollections="$(DoNotDropXmlSchemaCollections)"
DropConstraintsNotInSource="$(DropConstraintsNotInSource)"
DropDmlTriggersNotInSource="$(DropDmlTriggersNotInSource)"
DropExtendedPropertiesNotInSource="$(DropExtendedPropertiesNotInSource)"
DropIndexesNotInSource="$(DropIndexesNotInSource)"
DropObjectsNotInSource="$(DropObjectsNotInSource)"
DropPermissionsNotInSource="$(DropPermissionsNotInSource)"
DropRoleMembersNotInSource="$(DropRoleMembersNotInSource)"
DropStatisticsNotInSource="$(DropStatisticsNotInSource)"
ExcludeAggregates="$(ExcludeAggregates)"
ExcludeApplicationRoles="$(ExcludeApplicationRoles)"
ExcludeAssemblies="$(ExcludeAssemblies)"
ExcludeAsymmetricKeys="$(ExcludeAsymmetricKeys)"
ExcludeAudits="$(ExcludeAudits)"
ExcludeBrokerPriorities="$(ExcludeBrokerPriorities)"
ExcludeCertificates="$(ExcludeCertificates)"
ExcludeClrUserDefinedTypes="$(ExcludeClrUserDefinedTypes)"
ExcludeColumnEncryptionKeys="$(ExcludeColumnEncryptionKeys)"
ExcludeColumnMasterKeys="$(ExcludeColumnMasterKeys)"
ExcludeContracts="$(ExcludeContracts)"
ExcludeCredentials="$(ExcludeCredentials)"
ExcludeCryptographicProviders="$(ExcludeCryptographicProviders)"
ExcludeDatabaseAuditSpecifications="$(ExcludeDatabaseAuditSpecifications)"
ExcludeDatabaseRoles="$(ExcludeDatabaseRoles)"
ExcludeDatabaseScopedCredentials="$(ExcludeDatabaseScopedCredentials)"
ExcludeDatabaseTriggers="$(ExcludeDatabaseTriggers)"
ExcludeDefaults="$(ExcludeDefaults)"
ExcludeEndpoints="$(ExcludeEndpoints)"
ExcludeErrorMessages="$(ExcludeErrorMessages)"
ExcludeEventNotifications="$(ExcludeEventNotifications)"
ExcludeEventSessions="$(ExcludeEventSessions)"
ExcludeExternalDataSources="$(ExcludeExternalDataSources)"
ExcludeExternalFileFormats="$(ExcludeExternalFileFormats)"
ExcludeExternalTables="$(ExcludeExternalTables)"
ExcludeFilegroups="$(ExcludeFilegroups)"
ExcludeFileTables="$(ExcludeFileTables)"
ExcludeFullTextCatalogs="$(ExcludeFullTextCatalogs)"
ExcludeFullTextStoplists="$(ExcludeFullTextStoplists)"
ExcludeLinkedServerLogins="$(ExcludeLinkedServerLogins)"
ExcludeLinkedServers="$(ExcludeLinkedServers)"
ExcludeLogins="$(ExcludeLogins)"
ExcludeMessageTypes="$(ExcludeMessageTypes)"
ExcludePartitionFunctions="$(ExcludePartitionFunctions)"
ExcludePartitionSchemes="$(ExcludePartitionSchemes)"
ExcludeQueues="$(ExcludeQueues)"
ExcludeRemoteServiceBindings="$(ExcludeRemoteServiceBindings)"
ExcludeRoutes="$(ExcludeRoutes)"
ExcludeRules="$(ExcludeRules)"
ExcludeScalarValuedFunctions="$(ExcludeScalarValuedFunctions)"
ExcludeSearchPropertyLists="$(ExcludeSearchPropertyLists)"
ExcludeSecurityPolicies="$(ExcludeSecurityPolicies)"
ExcludeSequences="$(ExcludeSequences)"
ExcludeServerAuditSpecifications="$(ExcludeServerAuditSpecifications)"
ExcludeServerRoleMembership="$(ExcludeServerRoleMembership)"
ExcludeServerRoles="$(ExcludeServerRoles)"
ExcludeServerTriggers="$(ExcludeServerTriggers)"
ExcludeServices="$(ExcludeServices)"
ExcludeSignatures="$(ExcludeSignatures)"
ExcludeStoredProcedures="$(ExcludeStoredProcedures)"
ExcludeSymmetricKeys="$(ExcludeSymmetricKeys)"
ExcludeSynonyms="$(ExcludeSynonyms)"
ExcludeTables="$(ExcludeTables)"
ExcludeTableValuedFunctions="$(ExcludeTableValuedFunctions)"
ExcludeUserDefinedDataTypes="$(ExcludeUserDefinedDataTypes)"
ExcludeUserDefinedTableTypes="$(ExcludeUserDefinedTableTypes)"
ExcludeUsers="$(ExcludeUsers)"
ExcludeViews="$(ExcludeViews)"
ExcludeXmlSchemaCollections="$(ExcludeXmlSchemaCollections)"
GenerateSmartDefaults="$(GenerateSmartDefaults)"
IgnoreAnsiNulls="$(IgnoreAnsiNulls)"
IgnoreAuthorizer="$(IgnoreAuthorizer)"
IgnoreColumnCollation="$(IgnoreColumnCollation)"
IgnoreComments="$(IgnoreComments)"
IgnoreCryptographicProviderFilePath="$(IgnoreCryptographicProviderFilePath)"
IgnoreDdlTriggerOrder="$(IgnoreDdlTriggerOrder)"
IgnoreDdlTriggerState="$(IgnoreDdlTriggerState)"
IgnoreDefaultSchema="$(IgnoreDefaultSchema)"
IgnoreDmlTriggerOrder="$(IgnoreDmlTriggerOrder)"
IgnoreDmlTriggerState="$(IgnoreDmlTriggerState)"
IgnoreExtendedProperties="$(IgnoreExtendedProperties)"
IgnoreFileAndLogFilePath="$(IgnoreFileAndLogFilePath)"
IgnoreFilegroupPlacement="$(IgnoreFilegroupPlacement)"
IgnoreFileSize="$(IgnoreFileSize)"
IgnoreFillFactor="$(IgnoreFillFactor)"
IgnoreFullTextCatalogFilePath="$(IgnoreFullTextCatalogFilePath)"
IgnoreIdentitySeed="$(IgnoreIdentitySeed)"
IgnoreIncrement="$(IgnoreIncrement)"
IgnoreIndexOptions="$(IgnoreIndexOptions)"
IgnoreIndexPadding="$(IgnoreIndexPadding)"
IgnoreKeywordCasing="$(IgnoreKeywordCasing)"
IgnoreLockHintsOnIndexes="$(IgnoreLockHintsOnIndexes)"
IgnoreLoginSids="$(IgnoreLoginSids)"
IgnoreNotForReplication="$(IgnoreNotForReplication)"
IgnoreObjectPlacementOnPartitionScheme="$(IgnoreObjectPlacementOnPartitionScheme)"
IgnorePartitionSchemes="$(IgnorePartitionSchemes)"
IgnorePermissions="$(IgnorePermissions)"
IgnoreQuotedIdentifiers="$(IgnoreQuotedIdentifiers)"
IgnoreRoleMembership="$(IgnoreRoleMembership)"
IgnoreRouteLifetime="$(IgnoreRouteLifetime)"
IgnoreSemicolonBetweenStatements="$(IgnoreSemicolonBetweenStatements)"
IgnoreTableOptions="$(IgnoreTableOptions)"
IgnoreUserSettingsObjects="$(IgnoreUserSettingsObjects)"
IgnoreWhitespace="$(IgnoreWhitespace)"
IgnoreWithNocheckOnCheckConstraints="$(IgnoreWithNocheckOnCheckConstraints)"
IgnoreWithNocheckOnForeignKeys="$(IgnoreWithNocheckOnForeignKeys)"
IncludeCompositeObjects="$(IncludeCompositeObjects)"
IncludeTransactionalScripts="$(IncludeTransactionalScripts)"
NoAlterStatementsToChangeCLRTypes="$(NoAlterStatementsToChangeCLRTypes)"
PopulateFilesOnFileGroups="$(PopulateFilesOnFileGroups)"
RegisterDataTierApplication="$(RegisterDataTierApplication)"
ScriptDatabaseCollation="$(ScriptDatabaseCollation)"
ScriptDatabaseCompatibility="$(ScriptDatabaseCompatibility)"
ScriptDatabaseOptions="$(ScriptDatabaseOptions)"
ScriptDeployStateChecks="$(ScriptDeployStateChecks)"
ScriptFileSize="$(ScriptFileSize)"
ScriptNewConstraintValidation="$(ScriptNewConstraintValidation)"
ScriptRefreshModule="$(ScriptRefreshModule)"
TargetDatabaseName="$(TargetDatabaseName)"
TreatVerificationErrorsAsWarnings="$(TreatVerificationErrorsAsWarnings)"
UnmodifiableObjectWarnings="$(UnmodifiableObjectWarnings)"
VerifyCollationCompatibility="$(VerifyCollationCompatibility)"
VerifyDeployment="$(VerifyDeployment)"
>
<Output TaskParameter="IntermediateFileWrites" ItemName="FileWrites"/>
</SqlBuildTask>
On our previous sprint, the build and deploy of the project was working fine. When I did a TFS compare with the previous version there are no major differences.
这是我已经做的:
正如异常指出的那样,我仍在寻找目标文件中的任何重复键
任何帮助将不胜感激...
最佳答案
这似乎是因为重构日志文件(其中包含有关重命名列的信息)包含两个或多个具有相同 ChangeDateTime 值的条目。 SSDT 处理这些重复项的方式存在错误。
关于visual-studio-2015 - "The "SSDT 中的 SqlBuildTask "task failed unexpectedly..."异常,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39774755/