SQL Change Automation - error when doing refresh - Sequence contains no matching element

Hi,

When I click upon sync within visual studio I get ....
   Script verification failed
   Failed to very the migration script against the shadow database.

SQL Server error details ...Open log shows ...

Message = Sequence contains no matching element
Data = System.Collections.ListDictionaryInternal
InnerException = 
TargetSite = TSource Single[TSource](System.Collections.Generic.IEnumerable`1[TSource], System.Func`2[TSource,System.Boolean])
StackTrace =    at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
   at RedGate.Versioning.Client.VsShell.VisualStudio.ShellIntegration.VsDteProjectLocator.GetDteProjectFromPath(String filePath)
   at RedGate.Versioning.Client.VsShell.VisualStudio.ShellIntegration.VsDteProjectLocator.GetSsdtProjectFromPath(String filePath)
   at RedGate.Versioning.Client.VsShell.VisualStudio.Settings.SsdtProjectSettingsStrategy..ctor(IDteProjectLocator projectLocator, String filePath)
   at RedGate.Versioning.Client.VsShell.VisualStudio.Settings.SsdtProjectSettingsStrategyFactory.GetSettingsStrategy(String filePath)
   at RedGate.Versioning.Engine.Projects.ProjectSettings.SqlProj.ObjectMapping.MsBuildProjectMapper.MapTo(String filePath, IMsBuildSettingsRepresentation msBuildDatabaseProjectSettings)
   at RedGate.Versioning.Engine.Projects.ProjectSettings.SqlProj.ObjectMapping.MsBuildSettingsLoader`2.LoadSettings(String filePath, IProgressLogger progress)
   at RedGate.Versioning.Client.VsShell.VisualStudio.PendingChangeModel.<CompareSandboxToProject>d__89.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RedGate.Versioning.Client.VsShell.VisualStudio.PendingChangeModel.<CompareSandboxToProjectAsync>d__83.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RedGate.Versioning.Client.VsShell.VisualStudio.Commands.RefreshCommand.<Execute>d__11.MoveNext()
HelpLink = 
Source = System.Core
HResult = -2146233079

has anyone seen this error before. I have tried downloading the latest version.

Thanks, Julian
Tagged:

Answers

  • Hi @julian_nicholson

    Sorry to hear you're experiencing this issue!

    I'll need some more information from you to troubleshoot, what I'll do is reach out to you via a support ticket and we can get this resolved!

    Kind regards

    Dan Calver | Redgate Software
    Have you visited our 
    Help Center?

  • danjmackaydanjmackay Posts: 1 New member
    Hi there,

    I'm experiencing the same issue. Same exception and stack trace.
    I'm seeing an error in the Visual Studio Error List related to loading a migration that drops and recreates a CLR assembly and associated functions/aggregates.

    Visual Studio 2019 16.5.5.
    SQL Server Management Studio v18.5 (15.0.18330.0)
    Redgate SQL Change Automation 4.2.20176.20875
    Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64)   Sep 24 2019 13:48:23   Copyright (C) 2019 Microsoft Corporation  Developer Edition (64-bit) on Windows 10 Enterprise 10.0 <X64> (Build 17763: )  

    Happy to provide any additional detail required.

    Thanks, Dan.
  • Hi @danjmackay

    Apologies you're also experiencing this issue!

    Would you be happy for me to create a support ticket using your email address and reaching out to you directly and we can work through this issue and find a solution?

    Kind regards

    Dan Calver | Redgate Software
    Have you visited our 
    Help Center?

  • danjmackayRTdanjmackayRT Posts: 2 New member
    DanC said:
    Hi @danjmackay

    Apologies you're also experiencing this issue!

    Would you be happy for me to create a support ticket using your email address and reaching out to you directly and we can work through this issue and find a solution?
    Hi DanC,

    After getting some account stuff sorted, I'd like to raise a support ticket please.

    Thanks!
  • Hi @danjmackay

    Sure thing, if possible would you be able to submit a ticket through the portal on the page here: https://productsupport.red-gate.com/hc/en-us/requests/new

    Kind regards

    Dan Calver | Redgate Software
    Have you visited our 
    Help Center?

  • stevebsteveb Posts: 14 Bronze 1
    Hi,
    Was a solution found to this problem? I'm getting the same error and stack trace on VS2019 Enterprise 16.7.4 and SQL Change Automation 4.3.20288.22634.
    Thanks,
    Steve.
  • Hi @steveb

    So for this particular issue, we found the case to be that the TargetFrameworkVersion was v4.5.2 and was referencing a project of v4.6.2 and so that was too low and won't work since projects can only reference other projects that are the same version or lower.

    Changing the TargetFrameworkVersion of TestSCA to v4.6.2 allows the project to build successfully.

    If this isn't the case for yourself, please don't hesitate to reach out to us directly on support!

    Kind regards

    Dan Calver | Redgate Software
    Have you visited our 
    Help Center?

  • stevebsteveb Posts: 14 Bronze 1
    Hi Dan,

    Thanks for the info. My solution consists of a CLR assembly project and 3 SCA projects which reference the CLR project. All are set to use the same version of .NET framework (4.6.2, but I've tried others!). I seem to be able to deploy the databases to my local SQL server initially, but then the error occurs once the deployment has finished and the the SCA window is trying to refresh to show the new comparison of the project with the deployed DB.

    [There are also 2 other SCA projects in the solution which don't reference the CLR project, and they are fine.]

    My error (see below) is almost exactly the same as the OP's.

    Steve


    Message = Sequence contains no matching element Data = System.Collections.ListDictionaryInternal InnerException = TargetSite = TSource Single[TSource](System.Collections.Generic.IEnumerable`1[TSource], System.Func`2[TSource,System.Boolean]) StackTrace = at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate) at RedGate.Versioning.Client.VsShell.VisualStudio.ShellIntegration.VsDteProjectLocator.GetDteProjectFromPath(String filePath) at RedGate.Versioning.Client.VsShell.VisualStudio.ShellIntegration.VsDteProjectLocator.GetSsdtProjectFromPath(String filePath) at RedGate.Versioning.Client.VsShell.VisualStudio.Settings.SsdtProjectSettingsStrategy..ctor(IDteProjectLocator projectLocator, String filePath) at RedGate.Versioning.Client.VsShell.VisualStudio.Settings.SsdtProjectSettingsStrategyFactory.GetSettingsStrategy(String filePath) at RedGate.Versioning.Engine.Projects.ProjectSettings.SqlProj.ObjectMapping.MsBuildProjectMapper.MapTo(String filePath, IMsBuildSettingsRepresentation msBuildDatabaseProjectSettings) at RedGate.Versioning.Engine.Projects.ProjectSettings.SqlProj.ObjectMapping.MsBuildSettingsLoader`2.LoadSettings(String filePath, IProgressLogger progress) at RedGate.Versioning.Client.VsShell.VisualStudio.PendingChangeModel.d__87.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at RedGate.Versioning.Client.VsShell.VisualStudio.PendingChangeModel.d__81.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at RedGate.Versioning.Client.VsShell.VisualStudio.Commands.RefreshCommand.d__10.MoveNext() HelpLink = Source = System.Core HResult = -2146233079
  • Hi @steveb

    You're most welcome!

    Would you mind if I created a support ticket on your behalf and liaised with you via that? as I would need a copy of the project for the developers to troubleshoot and find out what's occurring in this particular instance. 

    Kind regards

    Dan Calver | Redgate Software
    Have you visited our 
    Help Center?

  • stevebsteveb Posts: 14 Bronze 1
    Hi Dan,
    Yes - that would be good. Many thanks.
    Steve.
  • Steve & DanC,

    Unfortunately I didn't get to the bottom of this one.
    I raised a ticket and worked with Dan and the support team, but I lost momentum and haven't been able to get back to this issue (apologies Dan!).
    While the test project I supplied did have a .Net targeting discrepancy, fixing that didn't fix my problem and I still ended up with the stack trace above.
Sign In or Register to comment.