Problem with transferring settings between different builds of R#4.5
Hi,
We have different versions of R#4.5 installed on two developer machines. One machine has lots of things configured and I want to transfer them all to the other one. I choose the option "Shared across team, per solution" in "Code style sharing", which places .resharper file in the solution directory. I take this file to the other machine, put it in the solution directory and see that R# doesn't hook up settings from it and overwrites it with default settings as soon as I visit the options menu. After some trial and error I have discovered that the following causes the problems:
here is the portion of the file from machine #1:
<Naming2>
<ExceptionName IsNull="False">
</ExceptionName>
<OverrideDefaultSettings>True</OverrideDefaultSettings>
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="TypesAndNamespaces" />
<PredefinedRule Inspect="True" Prefix="I" Suffix="" Style="AaBb" ElementKind="Interfaces" />
<PredefinedRule Inspect="True" Prefix="T" Suffix="" Style="AaBb" ElementKind="TypeParameters" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="MethodPropertyEvent" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="Locals" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="LocalConstants" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="Parameters" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PublicFields" />
<PredefinedRule Inspect="True" Prefix="v_" Suffix="" Style="AaBb" ElementKind="PrivateInstanceFields" />
<PredefinedRule Inspect="True" Prefix="v_" Suffix="" Style="AaBb" ElementKind="PrivateStaticFields" />
<PredefinedRule Inspect="True" Prefix="c_" Suffix="" Style="AaBb" ElementKind="Constants" />
<PredefinedRule Inspect="True" Prefix="c_" Suffix="" Style="AaBb" ElementKind="PrivateConstants" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="StaticReadonly" />
<PredefinedRule Inspect="True" Prefix="v_" Suffix="" Style="AaBb" ElementKind="PrivateStaticReadonly" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="EnumMember" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="Other" />
</Naming2>
Here is the same portion from machine #2 after I have introduced some changes manually:
<Naming2>
<ExceptionName IsNull="False">
</ExceptionName>
<OverrideDefaultSettings>True</OverrideDefaultSettings>
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="TypesAndNamespaces" />
<PredefinedRule Inspect="True" Prefix="I" Suffix="" Style="AaBb" ElementKind="Interfaces" />
<PredefinedRule Inspect="True" Prefix="T" Suffix="" Style="AaBb" ElementKind="TypeParameters" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="MethodPropertyEvent" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="Locals" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="LocalConstants" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="aaBb" ElementKind="Parameters" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="PublicFields" />
<PredefinedRule Inspect="True" Prefix="c_" Suffix="" Style="AaBb" ElementKind="Constants" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="StaticReadonly" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="EnumMember" />
<PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" ElementKind="Other" />
<PredefinedRule Inspect="True" Prefix="_" Suffix="" Style="aaBb" ElementKind="NotPublicStaticFields" />
<PredefinedRule Inspect="True" Prefix="v_" Suffix="" Style="AaBb" ElementKind="NotPublicInstanceFields" />
</Naming2>
Apparently my problem is that the attribute value has been changed from NotPublicStaticFields to PrivateStaticFields, which causes my R# to disregard it.
Is there a nice workaround for that (besides manually editing the xml)?
Thanks.
Please sign in to leave a comment.
Hello Ivan,
Have you tried using the Import/Export functionality?
1. On machine 1 open ReSharper > Options > Languages > Common > Code Style
Sharing, click Export and save settings as an xml file
2. Copy the xml file to machine 2
3. On machine 2 open ReSharper > Options > Languages > Common > Code Style
Sharing, click Import and import that xml file
Let me know if this helps. Thank you!
Andrey Serebryansky
Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Andrey,
Those are the exported .xml files that I am looking at.
Anyway, I have installed the same R# version on both machines (one had 4.5.1288.2 and the other one had 4.5.1231.7) and the problem has been solved. Just letting you know of that.