Hi All,
Just started to look at VS2005 beta 2 - I don't seem to be able to use the encapsulate field refactoring function.
I select a private class level variable and click encapsulate field.
The IDE then prompts for the property name and displays a code preview window which has the original field renamed to that of the property (highlighted) and no get/set type code.
Am I doing something wrong here
Cheers,
JW.

Refactoring: Encapsulate field.
Steve1031
Puttoju
http://lab.msdn.microsoft.com/productfeedback/default.aspx
and include an example of the code you are trying to encapsulate Thanks!
Ben
yuvald
Simple types - I've tried int and string without any success.
WernerF
JW.
shongalolo
What is the datatype of this variable you are trying to encapsulate Have you tried for something simple like a string or int
Regards,
Vikram
Chike_
I guess not supporting most of the refactoring options in Express is by design, It's one way to add value to Visual Studio.
In VS2003 I used a plug-in that provided code generation/refactoring support. Where's a good place to start learning about creating my own plug-ins to write code like this
Nate Heaton
SpinWebs
dave
Pointblank
Ramskar
The most likely reason that the Encapsulate Field refactoring is failing is that it is unable to find the Code Snippet that it needs to use in order to generate the actual property. This wouldn't effect the preview functionality, as you've noticed, because the preview only shows the references that would be updated and not the actual property insertion. There are 3 .snippet files that the feature relies on, EncapsulateField.snippet, EncapsulateFieldGet.snippet, and EncapsulateFieldSet.snippet. These are located in the %program files%\Microsoft Visual Studio 8\VC#\Snippets\1033\Refactoring directory. If those files exist then it's possible that the registration of that directory is incorrect. If you go to Tools menu there is an option for Code Snippets Manager. Check to see if that directory is listed in the left hand pane. If it's not, add it via the add... button at the bottom of that dialog, and then try the feature again.
Hope that helps!
Anson Horton
C# IDE PM
lumbus
RickC2003 --
Encapsulate field refactoring is not supported in VWD Express. In fact, C# express only supports two refactorings -- rename and extract method. The snippets are dropped in the location, but it isn't used.
HTH,
Karen
DoerakNL
Hi,
Looks like one of those Beta installation issues to me and the only option I can think of is re-install...
Regards,
Vikram