Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

StyleCop and = space

Tags:

stylecop

I am running StyleCop (which btw I completely recommend if you want to deliver high quality code)...

I have this line

[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable=false)]

update tried this too

[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)] 

StyleCop is reporting an error

Warning 2   SA1003: The spacing around the symbol '=' is invalid.

If this is invalid, what is valid?

like image 391
JL. Avatar asked Dec 09 '25 15:12

JL.


2 Answers

Make life easy on yourself and just CTRL+K+D the file in VS.

like image 70
Troy Hunt Avatar answered Dec 12 '25 23:12

Troy Hunt


Come on y'all. ;) Matt had it in the comment.

[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
like image 42
Sam Harwell Avatar answered Dec 13 '25 00:12

Sam Harwell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!