microsoft / DockerTools

Tools For Docker, including Visual Studio Provisioning and Publishing
Other
173 stars 26 forks source link

"Manage Docker Compose Launch Settings" not opening #374

Closed WolfspiritM closed 11 months ago

WolfspiritM commented 1 year ago

Hi,

Ever since docker compose support got introduced the "Manage Docker Compose Launch Settings" is very unstable for me.

I'm pretty sure that with the currently installed version of VS (17.5.3) I got it to open up, but right now I'm not able to get it to show at all. Whenever I click the menu entry nothing happens. This happens in a solution with many projects but also in a completly fresh solution with just one app for me now. The "Container Tools" Output window shows a docker-compose call and the answer e.g.

docker-compose  -f "C:\src\vs-bug-repro\vs-bug\docker-compose.yml" -f "C:\src\vs-bug-repro\vs-bug\docker-compose.override.yml" -p dockercompose5043361292943614007 --ansi never --profile "*" config --services
app1

But then nothing happens. No error and nothing. Sometimes it works but sometimes it doesn't. If it doesn't work it constantly doesn't work until I try it again a few days/weeks later when I think I'll give it a try again. I tried to create a new solution and added docker compose support and it doesn't show up for me aswell.

I also tried to switch between different docker-compose versions via docker desktop (the new and old) but that doesn't seem to change anything aswell.

This is happening on two different computers right now.

https://user-images.githubusercontent.com/5904171/228983379-92c30597-1558-419c-badc-9443eb938129.mp4

dbreshears commented 1 year ago

@WolfspiritM . Is this repro project something you can share? Can you create a new issue at https://developercommunity.visualstudio.com/VisualStudio/report which will then help to upload diagnostic logs and you can easily share project that reproduces this.

WolfspiritM commented 1 year ago

@dbreshears I've been digging into this a bit more now and I figured out why it's not opening. It's not depending on the project.

I found the container tools log which showed:

{
  "timestamp": "2023-04-07 01-33-32.249",
  "message": "An error occurred while launching ProfileManagerOnSelectedProject command",
  "exception": {
    "ClassName": "System.ArgumentException",
    "Message": "'794666666666667' is not a valid value for this property. Valid values are from Int32.MinValue through Int32.MaxValue.",
    "Data": null,
    "InnerException": null,
    "HelpURL": null,
    "StackTraceString": "   at System.Windows.Window.ValidateLengthForHeightWidth(Double l)\r\n   at System.Windows.Window.OnWidthChanged(Double width)\r\n   at System.Windows.Window._OnWidthChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\r\n   at System.Windows.PropertyChangedCallback.Invoke(DependencyObject d, DependencyPropertyChangedEventArgs e)\r\n   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)\r\n   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)\r\n   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)\r\n   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)\r\n   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)\r\n   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)\r\n   at Microsoft.VisualStudio.Docker.Compose.UI.LaunchSettings.LaunchSettingsDialog.Initialize()\r\n   at Microsoft.VisualStudio.Docker.Compose.UI.LaunchSettings.LaunchSettingsDialog..ctor(LaunchSettingsViewModel viewModel)\r\n   at Microsoft.VisualStudio.Docker.Compose.Commands.ProfileManagerOnSelectedProjectCommandProvider.<<CreateCommand>b__5_2>d.MoveNext()",
    "RemoteStackTraceString": null,
    "RemoteStackIndex": 0,
    "ExceptionMethod": "8\nValidateLengthForHeightWidth\nPresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\nSystem.Windows.Window\nVoid ValidateLengthForHeightWidth(Double)",
    "HResult": -2147024809,
    "Source": "PresentationFramework",
    "WatsonBuckets": null,
    "ParamName": null
  }
}

I then was able to figure out that in the privateregistry.bin hive where VS stores the configuration I have this setting:

Software\Microsoft\VisualStudio\17.0_90e049ab\VisualStudioContainerTools\LaunchSettingsWindowSize
794.666666666667,786

I've reverted that to 794,786 and started VS again and out of sudden the Launch Settings Dialog appears again. I then resized that window by dragging the bottom right corner and closed the dialog and after that the dialog is gone again.

My best bet would be that this has something to do with parsing "794.666666666667" on a german system where the seperator is "," and not ".". Is the parsing maybe missing some CultureInfo.InvariantCulture or something like that? 😃

dbreshears commented 1 year ago

@WolfspiritM . Indeed, while I haven't reproduced, looking at our code I am pretty sure I found where this may be happening. Thank so much for tracking this down, saved a ton of time. I have logged a bug in our internal tracking database and will get this fixed. If you are not blocked, at this point we can address in 17.7 Preview 1 based on VS schedule.

WolfspiritM commented 11 months ago

@dbreshears Just wanted to let you know that with 17.7 this issue is fixed. Thank you!

danielwinkler commented 11 months ago

Thank you guys for fixing this!