Internal Error

I've done something to the main form on a very large project. I get this error when I try to scan it.

Internal Error: Resources.ApplyResources() detected in SBT_Form1.Designer.vb, but we failed to open a resource set.

Any direction on how to fix it?

Germany

Hi,

I haven't really looked at this yet, but I do know that it only occurs during the controls scan via source code.

Can you try using the scan via designer?

Normally, when you select the project in the Add-In, you will see the following dialog:
Image
Please try selecting the option via designer.

If you do not see this dialog, then open the project options dialog (5th button on the toolbar) and unchecking the option Scan controls by scanning InitializeComponent().
Image
Then rescan the project.

The option via designer opens a designer window for the form or usercontrol and detects the properties via Visual Studio's object model. The option via source code analyzes the code in the function InitializeComponent().

Phil


Germany

During the scan via source code the Add-In looks for a .resx file with the same name as the form (or usercontrol) and the extension .resx. If the file exists, it reads the contents into a ResourceSet.

If the scan detects the function call resources.ApplyResources(), then it will fetch the relevant text strings from the ResourceSet.

However, if it detects the function call resources.ApplyResources(), but did not find the .resx file, then it has a problem.

So far as I know, this file has to be in the same directory as the code files and has to have the same basic name. I don't know how Visual Studio reacts if the file is missing.

Is the .resx file actually present for the form or usercontrol causing the problem, or is it missing?

Phil

Well, that made it stop throwing the error, but i figured out it's not scanning the controls on the sbt_form1. I even went back in source control and pulled the files from a month or so back, didn't help.

Here's the output releated to sbt_form1 scan :
Scan source in SBT_Form1.Designer.vb
Process 2352 scan results for SBT_Form1.Designer.vb
Scan source in SBT_Form1.vb
Process 5321 scan results for SBT_Form1.vb

Screenshots of the project attached



Germany

Can you please scan the project again, and then send me the log file.

At the bottom of the Add-In's help menu there is a command "send feedback with log file" which you could use. (There is also a command to open the directory where the log file is stored.)

Phil


Attached...

Guess I screwed it up good :-)

You will probably see in the log file I still get the "Description: The requested operation cannot be performed on a file with a user-mapped section open." all the time, but doesn't seem to bother anything. I've always gotten this, even in the other other project that works fine.

Germany

This seems like a ridiculous coincidence, but I think that I have fixed this for another user - today smile. I uploaded a new version (5.0x.0038) about three hours ago. Can you download this version and see whether it fixes the problem?

I think the problem is, that the class is called Form1, but the files are called SBT_Form1. This causes a bug in the Add-In. You could also try renaming the class to SBT_Form1 (via the context menu).

Phil


Do you know what an invisible window is?


Closing invisible window Form1.vb


Exception Attempted to read or write protected memory. This is often an indication that other memory is corrupt. closing invisible windows
Exception Attempted to read or write protected memory. This is often an indication that other memory is corrupt. closing invisible windows
Exception Attempted to read or write protected memory. This is often an indication that other memory is corrupt. closing invisible windows
Exception Attempted to read or write protected memory. This is often an indication that other memory is corrupt. closing invisible windows
Exception Attempted to read or write protected memory. This is often an indication that other memory is corrupt. closing invisible windows
Exception Attempted to read or write protected memory. This is often an indication that other memory is corrupt. closing invisible windows
Exception Attempted to read or write protected memory. This is often an indication that other memory is corrupt. closing invisible windows

Germany

It is possible for an Add-In (or a macro) to open a window in Visual Studio, but make it invisible.

When the Add-In is scanning controls, it opens the designer window for each form, does the scan, and then closes the window again. In this case, it keeps the windows invisible, which prevents disturbing graphics updates. It might also be faster.

Visual studio itself, or other Add-Ins, may also use invisible windows for some purposes.

I think that I had some problems in the past with invisible windows which were not closed correctly. To fix this, I added a function which simply checks for any invisible windows ans closes them. The exceptions in your log file are generated in this function. To tell the truth, I don't know whether I really need this function. It is still there, mainly because of the principle "If it ain't broke, don't fix it".

Phil


The new version seemed to fix it! I will play around with it some more after I get the little one to bed in a few hours. I've got to get this release ready, plan on working all night tonight.

Thanks a Million!