4

I am trying to edit a custom ruleset file for FxCop. When I open a ruleset file I receive this message:

Width of the image strip must be a positive multiple of
ImageSize.Width
Parameter name: value

It looks like the file is already open, because when I try to edit as XML it asks me if I want to close it first. I cannot edit as XML, either.

Tonatio
  • 4,026
  • 35
  • 24
  • Can you open the file in an external editor (notepad, sublime text) and paste its contents in here? Have you tried reopening the project/solution it is in? – Matthijs Jun 12 '15 at 08:40
  • I can open the file in an external editor. Also, I have reinstalled Visual Studio (I am using Visual Studio Professional 2013 update 4). I have tried in another computer and I get the same error, `*.ruleset` files cannot be open in Visual Studio. Possible Visual Studio bug? – Tonatio Jun 12 '15 at 12:38
  • None of the ruleset files can be opened, or just your particular one? Try making a new ruleset in a clean project. Just to make sure it is not because of VS itself. If it is not VS, then paste the contents of the ruleset in here. – Matthijs Jun 15 '15 at 13:06
  • Same error message happens when opening Code Analysis Settings page in solution properties. – SalgoMato Feb 16 '21 at 11:10

1 Answers1

6

Came across this problem today. Tried repairing the Visual Studio installation without success. In the end, I found the problem in my laptop: I had previously set the display to scale at 110% a few months back, and the error message made this a likely issue - so I set it back to 100% and it worked! I am using Visual Studio 2017 on Windows 10.

Sandipan
  • 76
  • 1
  • 2
  • 3
    Wow - impressive that you were able to figure that out. Thank you. Opened it up as a VS issue here: https://developercommunity.visualstudio.com/content/problem/533391/ruleset-file-cannot-be-opened-if-display-settings.html – Mark Z. Apr 15 '19 at 13:11