Refactoring Fails

Topics: Developer Forum
Jul 30, 2007 at 11:15 PM
I cannot figure out why this doesn't seem to work for me. I right-click on the string, goto to Refactor -> Extract To Resource and nothing happens (other than the context menu gets hidden). There aren't any errors or anything. Nothing in my project is readonly and the resource file already exists. I have tried reinstalling and restarting both VS 2005 and Win XP. I am using VS 2005 Team Dev with SP1 on Win XP with VB.Net.

Any help would be appreciated. I would really love to use this tool!
Coordinator
Aug 11, 2007 at 2:46 PM
Could you give me more details about the project, such as language, project type and also if you have "Other files" category in your solution.

Thanks,
Bertan
Aug 17, 2007 at 2:15 PM
We have here the same problem with some VS2005 C# projects. We noticed that projects which contains file resources are affected from the problem.

Steps to reproduce
--> Resources.resx -> Add existing file --> Add a text file

Now the resource refactoring tool doesn't show up anymore.
Aug 21, 2007 at 11:49 AM
I don't really have the time to create a CodePlex patch at the moment but below is a unix style patch to fix this issue. It has to be applied againts CommonVB.ResourceFile.vb. The patched code skips file resources.

Bertan could you create a real patch?

Thanks
Tobias


283c283,284
< If resource.GetValueTypeName(New System.Reflection.AssemblyName() {}).Equals(GetType(String).AssemblyQualifiedName) Then
---
> If resource.GetValueTypeName(New System.Reflection.AssemblyName() {}).Equals(GetType(String).AssemblyQualifiedName) _
> AndAlso resource.FileRef Is Nothing Then
Coordinator
Sep 4, 2007 at 4:56 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.