Suggestion: ASP.NET naming conventions

Hi,

Currently I can't see an easy way to get Resharper to accomodate ASP.NET naming conventions - this can lead to it recommending name changes that at best mean you're stepping away from standards for ASP.NET and at worst break things horribly.

For example, the "label1_Click" style convention for naming using object_event - this is recommended to be changed to Label1Click.  That works fine, though as I say it's not standard as far as I can see.

On the other end of the spectrum it will happily let you rename "Page_Load" to "PageLoad" which then means it isn't called anymore.

I use the standard Resharper conventions for my own code, but ASP.NET seems to have its own way of doing things and it would be nice for code that's in those classes to be able to stick to those standards, and certainly Resharper shouldn't let you do silly things like rename "Magic" methods like Page_Load.

Matt.

1 comment

One default you should change that might help with this:

Go to ReSharper -> Options
Click "Naming Style" under "Languages / Common"
Click the "Advanced Settings..." button
In the "Even subscriptions on fields: text box, enter: $object$_$event$
Click OK
Click OK

I don't understand why this isn't the default value, to be honest (many
people have had this issue here), but making this change seems to resolve
most of my issues.


"Matt Peddlesden"  wrote in message
news:24315200.785841297261063321.JavaMail.devnet@domU-12-31-39-18-36-57.compute-1.internal...

Hi,

Currently I can't see an easy way to get Resharper to accomodate ASP.NET
naming conventions - this can lead to it recommending name changes that at
best mean you're stepping away from standards for ASP.NET and at worst break
things horribly.

For example, the "label1_Click" style convention for naming using
object_event - this is recommended to be changed to Label1Click.  That works
fine, though as I say it's not standard as far as I can see.

On the other end of the spectrum it will happily let you rename "Page_Load"
to "PageLoad" which then means it isn't called anymore.

I use the standard Resharper conventions for my own code, but ASP.NET seems
to have its own way of doing things and it would be nice for code that's in
those classes to be able to stick to those standards, and certainly
Resharper shouldn't let you do silly things like rename "Magic" methods like
Page_Load.

Matt.

---
Original message URL: http://devnet.jetbrains.net/message/5285938#5285938

0

Please sign in to leave a comment.