Domanda

I have two settings files in my project. One lies next to the Visual Studio solution file. The other one is in an subfolder which is used for export to other products we develop.

  • ...
  • solution.sln
  • settings.stylecop (linked to the other settings file)
  • Export (folder)
    • settings.stylecop (<= used for export, no merging)
    • stylecop.targets
    • stylecop.dll
    • etc...

When I link the sln settings file to the one in the export folder StyleCop has all rules activated. It seems that the linking is ignored. But when I open the sln settings file in the editor it seems that the setting are inherited.

What have I made wrong? Now I have to manually ensure that both files are always identical.

È stato utile?

Soluzione

It sounds like your LinkedSettingsFile value is incorrect. To make sure that its value is treated as being relative to the settings file (and not the working directory of the executing process) it must start with a period. For example:

<StyleCopSettings Version="105">
  <GlobalSettings>
    <StringProperty Name="MergeSettingsFiles">Linked</StringProperty>
    <StringProperty Name="LinkedSettingsFile">.\SomeFolder\Settings.StyleCop</StringProperty>
  </GlobalSettings>
</StyleCopSettings>

There is some more information in this CodePlex issue.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top