I've noticed that when I have VS2019 configured to restrict formatting to "changed lines", ContinuousFormatting doesn't seem to follow that restriction, and changes otherwise-untouched lines in code (even when VS2019's settings are to leave spacing as-is in those cases). In team environments, that can be problematic, filling up commits with format-only changes (particularly undesirable in maintenance repos).
It's definitely CF plugin causing the (mis)behavior, because the behavior ends when CF is disabled/uninstalled, and returns when enabled/reinstalled. If VS's format rules say to leave a given situation as-is for spacing/alignment/breaks, I do not understand why ContinuousFormatting causes formatting to change untouched lines.
This can become a real problem, esp. when VS's native formatting controls don't quite support the team or project format standards -- normally the answer is just to leave the "atypically-formatted" lines untouched, or manually fix them, but with ContinuousFormatting that means having to remember to disable the plugin before working on such projects. I'm open to any suggestions on how to get CF to change this behavior?
Hello. I'm trying out VisualCommand and looking into command example 41. Insert explicit named parameters for a method call.
When I try to run it I get this error, Visual Studio 2019
(0,0): error CS1701: Assuming assembly reference 'Microsoft.VisualStudio.Shell.15.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' matches 'Microsoft.VisualStudio.Shell.15.0, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a', you may need to supply runtime policy
(42,20): error CS0721: 'System.Collections.Immutable.ImmutableArray': static types cannot be used as parameters
using (var client = new NamedPipeClientStream("MyPipe"))
{
client.Connect();
using (var reader = new StreamReader(client))
{
using (var writer = new StreamWriter(client))
{
var input = "My message!";
writer.WriteLine(input);
writer.Flush();
MessageBox.Show(reader.ReadLine());
}
}
}
@Ncerna To count in numbers how many times you compile the project or press F5 in the IDE when developing an application, you can use my Visual Commander extension with “Monitor commands execution” example:
https://vlasovstudio.com/visual-commander/extensions.html#CommandEvents
Just replace MessageBox.Show with writing a string to a file with the command name and a timestamp. Then you can easily query this file from a standalone application to give you stats.