Options

Error when loading Visual Studio 2017

I recently just got a new computer, and had to reinstall SQL Change Automation on top of my new Visual Studio instance.  On my old machine, I was able to use SQL Change Automation on Visual Studio 2017 without issue.

I am getting an error on my new machine, and it prevents my Visual Studio instances from ever loading the SQL Change Automation window, so I cannot script out any changes.  The error stack is below.  Please help!

SQL Change Automation encountered an error.

Message = The ViewManager.ActiveView must be a View contained within the ViewManager.WindowProfile.
ParamName = 
Data = System.Collections.ListDictionaryInternal
InnerException = 
TargetSite = Void ThrowExceptionForHRInternal(Int32, IntPtr)
StackTrace =    at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at RedGate.Versioning.Client.VsShell.VisualStudio.Windows.ToolWindow.ToolWindowVisibility.FindOrCreateAndShowToolWindow()
   at RedGate.Versioning.Client.VsShell.Ui.ExceptionHandler.Wrap[T](Func`1 func, T defaultReturnValue)
HelpLink = 
Source =    at Microsoft.VisualStudio.PlatformUI.Shell.ViewManager.SetActiveView(View view, ActivationType type)
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ShowInternal(ShowFlags showFlags)
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.<Show>b__505_0()
   at Microsoft.VisualStudio.ErrorHandler.CallWithCOMConvention(Func`1 method, Boolean reportError, Boolean setShellErrorInfo)
HResult = -2147024809
Tagged:

Answers

  • Options
    Alex BAlex B Posts: 1,132 Diamond 4
    Hi @berkshireseany,

    Unfortunately this looks like an issue with Visual Studio:
    https://developercommunity.visualstudio.com/content/problem/244883/the-viewmanageractiveview-must-be-a-view-contained.html

    We have had this a few times from our customers and it seems in some cases they needed to reinstall Visual Studio, though you should try updating SQL Change Autmation to the latest version from here just to see if that has any effect: https://marketplace.visualstudio.com/items?itemName=vs-publisher-306627.RedgateSqlChangeAutomation

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
  • Options
    Hi Alex,

    I came in after being off for a little bit, and it seems to have resolved itself.  Very odd.  However, I'm running into a different issue, and I can't tell if it's a problem with SQL Change Automation, or VS and SQL Server Projects.  This is only happening on my machine, and the machine of one other developer in our team, both are brand new machines.

    My machine has SQL Server Data Tools 15.1 installed, and I have the targeting packs for every .NET Framework version up through v4.7.2.

    When I got latest of our code from TFS, I receive this error when trying to load any of our existing database projects. I've seen similar errors before, but never where the target framework was listed as "" (blank).

    My project file, before choosing any of the options on that prompt, looks like this (we are using .NET Framework v4.6.2).

    Option 2 does nothing (presumably because it doesn't know what the target framework is), and option 3 just leaves the project unavailable. So I used option 1, thinking it would resolve whatever the problem was. Upon choosing the option, my project file changed to this (changed to .NET Framework v4.5.2). Of note, if I close and reopen the project, I get the same prompt showing that the target framework is still blank. So option 1 effectively did nothing as well.

    Since the project was at least accessible now, I figured I could use project properties to change it back to v4.6.2. When I opened the project properties, I found that the framework version dropdown was disabled, which I've never seen before.

    Nothing I've tried has allowed me to get the project to open correctly. I've uninstalled all of Visual Studio and my plugins/extensions and reinstalled from scratch, but the error persists. My old machine also had Visual Studio 2015 installed, so I installed that too, thinking maybe we had some weird project dependency, but that didn't change anything.

    Finally, I created 2 brand new SQL Server projects on my machine to test to see if they worked. One of them I created as a basic SQL Server Data project, and the other I created as a SQL Change Automation project. BOTH of the brand new projects work flawlessly. The framework dropdown looks as I would expect it to

    I had none of these issues on my old machine. My new machine is the only one with this problem, so I don't want to try to recreate the projects from scratch if I can help it, as it may affect the rest of my team.  Have you guys seen this happen at all before?  Is there any way to solve it?

  • Options
    Alex,

    I seem to have solved the issue.  We have always linked our NuGet packages to C:\packages, so that we don't get duplicate files being pulled down in a ton of different places.  I didn't have my nuget.config set up on my new machine, so it was pulling files down to a different location.  I had separate build errors that led me to find that problem.  Once I resolved that, I closed and reopened my solution and the projects are now working ok.  Sorry about that, I never would have correlated that to the messages I was getting before.

    If I run into anything else I will let you know.  For now everything appears to be working.

    Thanks,

    Sean
  • Options
    Alex BAlex B Posts: 1,132 Diamond 4
    Hi @berkshireseany,

    That is all a bit strange, but glad it's all working for you fine now!  Thanks for letting us know!

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
Sign In or Register to comment.