Resharper ->Edit ->GenerateCode ->Properties Disabled?

I'm using Resharper 5.1.3. When I put my cursor inside of a class and hit Alt-Insert I see the menu I expect, but Properties and Read Only Properties are greyed out. I can generate a constructor just fine. Any idea what my problem might be?

Thanks,
Mike

4 comments

Hello Mike,

Could you please attach a small sample solution that would demonstrate this
problem? Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I'm using Resharper 5.1.3. When I put my cursor inside of a class and
hit Alt-Insert I see the menu I expect, but Properties and Read Only
Properties are greyed out. I can generate a constructor just fine. Any
idea what my problem might be?

Thanks,
Mike
---
Original message URL:
http://devnet.jetbrains.net/message/5301307#5301307



0

I created a brand new project, and put the cursor inside of the class Program where I would normally insert a property, then hit Alt-Insert. Attached is a screenshot of what I see, and the project that I reproduced it in.



Attachment(s):
disabled-menu-options.png
ResharperTest.zip
0

Hello Mike,

Generate | Properties/Read-only properties actions generate properties for
your type's fields. When there are no fields, those actions are disabled
since there's nothing to generate. Could you please clarify what kind of
behavior do you expect from Generate | Properties in your example?

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I created a brand new project, and put the cursor inside of the class
Program where I would normally insert a property, then hit Alt-Insert.
Attached is a screenshot of what I see, and the project that I
reproduced it in.

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



0

Ah, I understand now. What I expected what for it to generate an automatic property for me, something very similar to what happens when I type "prop" then tab in visual studio

public [Type] [PropertyName] { get; set; }

but it sounds like maybe GenerateCode is more about generating code where everything can be inferred as opposed to templating code where I have to fill in the blanks. Thank you for your quick response!

- Mike

0

Please sign in to leave a comment.