Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/IDE/Refactoring/Find Unit    [ Add a report in this area ]  
Report #:  89089   Status: Closed
Refactoring "Find Unit" often does not work any more
Project:  Delphi Build #:  15.0.3890.34076
Version:    15.0 Submitted By:   Jeroen Pluimers
Report Type:  Basic functionality failure Date Reported:  10/19/2010 3:52:24 AM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   280894
Resolution: Cannot Reproduce (Resolution Comments) Resolved in Build: : 15.0.3940.34982
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 23
Description
This problem is in a class "of intermittend" issues that do not always reproduce.
Therefore do not close it before contacting the original author.

Since Delphi XE, the "Find Unit" refactoring often does not work for me any more.

Delphi Refactoring in Delphi has become more stable over time, so it gets harder and harder to reproduce instabilities.
This particular feature goet less stable in the last release.
Therefore it might need special attention: the cause might make other features unstable as well.

This case reproduces it only some of the times. If I find a way to reproduce it better, I will amend the steps.
I have a gut feeling that the problem is caused by the facts that:
1. the "Find Unit" refactoring sometimes is asynchronous
2. if "Find Unit" is aready running, it is not disabled in the menu.

I have not found out yet the "sometimes".

After the error, the IDE becomes unstable.

You cannot copy/paste the error with Ctrl-C to the clipboard, hence the attachment of one of the errors (so you have an idea how the dialog looks like).

Besides RAD Studio XE, I have installed the latest GExperts and Model Maker Code Explorer.
Even when I have disabled those two experts, the "Find Unit" refactoring often fails.

mtError Dialog

Title=CodeGear RAD Studio
Content=System.IO.FileLoadException: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
Buttons=[OK]


mtError Dialog

Title=CodeGear RAD Studio
Content=System.NullReferenceException: Object reference not set to an instance of an object.
Buttons=[OK]



Steps to reproduce (I perform all the "New..." stuff using the "Tool Palette" search).

1. Start a new instance of RAD Studio XE
2. Create a new VCL Forms Project
3. Swithch the form view to the code editor view using F12
4. Create a new Unit (which is now Unit2)
5. Paste the Doit method into Unit2 so the unit looks like this:
unit Unit2;

interface

implementation

procedure DoIt;
var
  S: string;
begin
  S := NullAsStringValue;
end;

end.

6. Put the cursor on NullAsStringValue
7. Perform a "Refactor, Find Unit" (Alt-O, U) from the menu (it should return the Variants unit)
8. Close the project
9. Create a new VCL Forms Project
10. Swithch the form view to the code editor view using F12
11. Create a new Unit (which is now Unit2)
12. Paste the Doit method into Unit2 so the unit looks like this:

unit Unit2;

interface

implementation

procedure DoIt;
var
  S: string;
begin
  S := TWinControl.ClassName;
end;

end.

13. Put the cursor on TWinControl
14. Perform a "Refactor, Find Unit" (Alt-O, U) from the menu (it should return the Controls unit, but often you now get one of the two errors below).
15. If the "Find Unit" is asynchronous, then:
15a. Put the cursor on ClassName
15b. Perform a "Refactor, Find Unit" (Alt-O, U) from the menu (it should not return a unit at all, but often you now get one of the two errors below).
Steps to Reproduce:
Steps to reproduce (I perform all the "New..." stuff using the "Tool Palette" search).

1. Start a new instance of RAD Studio XE
2. Create a new VCL Forms Project
3. Swithch the form view to the code editor view using F12
4. Create a new Unit (which is now Unit2)
5. Paste the Doit method into Unit2 so the unit looks like this:
unit Unit2;

interface

implementation

procedure DoIt;
var
  S: string;
begin
  S := NullAsStringValue;
end;

end.

6. Put the cursor on NullAsStringValue
7. Perform a "Refactor, Find Unit" (Alt-O, U) from the menu (it should return the Variants unit)
8. Close the project
9. Create a new VCL Forms Project
10. Swithch the form view to the code editor view using F12
11. Create a new Unit (which is now Unit2)
12. Paste the Doit method into Unit2 so the unit looks like this:

unit Unit2;

interface

implementation

procedure DoIt;
var
  S: string;
begin
  S := TWinControl.ClassName;
end;

end.

13. Put the cursor on TWinControl
14. Perform a "Refactor, Find Unit" (Alt-O, U) from the menu (it should return the Controls unit, but often you now get one of the two errors below).
15. If the "Find Unit" is asynchronous, then:
15a. Put the cursor on ClassName
15b. Perform a "Refactor, Find Unit" (Alt-O, U) from the menu (it should not return a unit at all, but often you now get one of the two errors below).
Workarounds
None
Attachment
None
Comments

Thomas Holdt at 10/26/2010 3:17:52 AM -
We have this really annoying problem too. The App is quite  big, about 2 Million lines compiled, but obviously the bug does not need a big app. Would be nice if this issue could be cleared asap

Heinrich Ulbricht at 1/27/2011 8:01:14 AM -
We also experience this issue with 100% hit rate. The Find Unit never worked in Delphi XE. Error message is also

"System.IO.FileLoadException: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)"

Checking with Process Monitor what Delphi is doing in the background while trying to open the Find Unit dialog I noticed it looking for dcc150il.dll, which it never finds. Don't know if a "normal" Delphi XE shows the same behavior. And it takes several seconds until the error dialog appears.

My system is Windows 7 32bit. I have an old Delphi 2009 installed in parallel. GExperts is not yet installed in the new Delphi XE.

Karlheinz Späth at 2/19/2012 7:46:55 AM -
I have the same Problem with Delphi XE Enterprise. German Version. The Error occurs every time when I try to use the "Find Unit" refactoring.

Server Response from: ETNACODE01