XamlStyler
XamlStyler copied to clipboard
Settings file is not loaded if solution is opened
If you define an External Configuration File without path and put the file next to the .sln file (as described here) the file gets not loaded in every situation. It does not work if you open a recently used solution via right click on a VisualStudio icon/shortcut. It does work if you double click on the .sln file directly.
Are there any informations regarding the investigation whether this is a bug of VS or XamlStyler? Respectively can someone predict when it will be fixed?
I was previously not able to repro the problem, but I try again with latest version of VS + XAML Styler. If anyone is seeing this problem, please post versions for VS + XAML Styler to help investigate.
Update: I am not able to repro on 15.8.7 with latest out of master.
The issue is still reproduceable as described in my opening post. Setting: External configuration file: Settings.XamlStyle I put the file next to the .sln file. The content of the file is default (https://github.com/Xavalon/XamlStyler/wiki/External-Configurations) except that I changed the value of AttributesTolerance to 4 as my test case to see if this file is used or not. Visual Studio 15.9.2 XAML Styler 3.1
I was able to reproduce the issue when debugging XamlStyler.Console. I guess the same happens when running the VS extension. Images: https://imgur.com/a/uG8TgNY The image XamlStyler_Issue153_Image2 shows the used options: Check the watch window! The image XamlStyler_Issue153_Image1 shows how the given configuration file is loaded: Check watch window again! With this settings there is no directory set when the file gets loaded. The variable config contains only a filename: "Settings.XamlStyler". And so File.Exists() consider this a relative path and will check the current working directory which is not in both cases, which I described in my first post, the same! https://docs.microsoft.com/en-us/dotnet/api/system.io.file.exists?view=netframework-4.7.2 Could this be the reason?
@jcsonder Can you share the configuration file you were using here to help debug?