Loading...
 
Multi-Language Add-In for Visual Studio

Multi-Language Add-In for Visual Studio


"Visual Basic Compiler has stopped working" error during scanning project.

Hi,

"Microsoft (R) Visual Basic Compiler has stopped working
A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available."

Visual Studio crashes with this error while Multi-Language Add-In is scanning the project. And occasionally the Multi-Language Add-In throws "System Out Of Memory Exception". It's relatively big project and we have to start localization immediately.

I know that it's difficult to determine the problem with such a generic error.I hope you can help me in pinpointing the main cause of the problem.
Thanks in advance.

Germany

Hi,

firstly, sorry that I didn't reply earlier. I have been a bit lazy in replying recently.frown

As you suspected, I cannot really say what is causing the error.

The Add-In has two ways to scan the controls in a Windows Forms project.

  • via the designer windows
  • via the source code


In the first case, it opens the Forms and UserControls in a designer window (which usually remains invisible) and scans the controls using the Visual Studio object model.

In the second case, it analyses the code in the InitializeComponent() function.

I strongly favour the first method. This should be much more reliable in almost all cases. However, loading the designer window can execute user code. For example, if you have a UserControl on a Form, code in the UserControl will be executed when the Form is loaded into a design window. I presume that this is the reason that the VB compiler is being executed.

The second method will only work as long as the code in InitializeComponent() looks the way I expect it to look. I don't actually compile the function. I just scan it for certain actions (creating objects, setting properties). It wouldn't surprise me if some third party controls generated code which the Add-In will not analyze correctly. Although I think this method works properly, I still trust it less than the other method.

However, in your case, scanning via InitializeComponent() might work where the other method fails. Usually, a dialog appears before the scan in which you can choose this option. Otherwise I think that you can select it via the project options dialog.

Coming back to the original error message, I have searched more information in the internet. None of the entries was very useful (in fact this forum posting was fourth in the search results). However the error report at http://connect.microsoft.com/VisualStudio/feedback/details/308353/microsoft-r-visual-basic-compiler-has-stopped-working suggests a workaround which you might like to try. To be honest, I am a bit skeptical about it, but you never know.

Phil


Hi Phil,
thanks for your answer, I tried scanning project via InitializeComponent option and I also removed bin and obj folders, and finally I succeeded in scanning the project.
However, now I get the same error while I'm working on multilang window to decide strings that need translation, sometimes when I checked the item or when I expand/collapse the entry.
By the way the day before I sent you an error report (a System.OutOfMemoryException error) from melikedi at gmail.com. Do you think that using the new version you mentioned can solve the problem?
Thanks.

Germany

There are several things which could be using too much memory:

  • Opening (invisible) designer windows during the scan
  • The dataset which holds the project database
  • The datasets which holds the temporary information stored in the two ml_temp_xxx.xml files


If the memory used by the designer windows is the problem, I think garbage collection might actually help.

What might also help is not to scan the complete project. You can so this be selecting "Do not initialize" for Controls and Source-Code in the dialog which appears before the scan (if it has not been disabled). Then you can select the command "Scan selected components" from the rescan menu (first icon on the toolbar) and scan a subset of the components.

(If that doesn't make sense, I will post some screenshots.)

If the dataset for the project database is the problem, then I am in trouble. I think that this would be difficult to optimize.

If the datasets used for the ml_temp_xxx.xml files is the problem, then I can do without these files. These are used when you restore the grids without actually rescanning the project. I could make this optional in the project settings (or even dump the whole feature).

I am going to do some testing in the next few days and I hope to learn more about the memory problems.

Phil


Hi Phil,
I finally manage to bypass memory errors and scan all controls and source code of the project, I just made necessary code changes and checked the entries that needs translation in source code tab, and I deselect unnecessary items in controls tab. Then I choose "add language" menu to add English to project, and this is where problem started. I experienced some IDE crashes with either memory errors or the error I mentioned in my original post. Now, I don't know what happened, but all texts in controls tab are selected again. This is a huge project and it took my two days to overview controls to determine text to be translated and I should do it all over now.

my questions are:
1- is rescanning controls can lead to the situation I described?
"Restore from database" option didn't load the controls tab after the IDE crashes,so I used "rescan with source code" option as you suggested(please look at your first answer in the topic)
2- is there a way to recover my work via ml_temp_xxx.xml?

I already loose a lot of time, so please help me urgently.

thanks in advance.

Germany

> Hi Phil,
> I finally manage to bypass memory errors and scan all controls and source code of the project, I just made necessary code changes and checked the entries that needs translation in source code tab, and I deselect unnecessary items in controls tab. Then I choose "add language" menu to add English to project, and this is where problem started. I experienced some IDE crashes with either memory errors or the error I mentioned in my original post. Now, I don't know what happened, but all texts in controls tab are selected again. This is a huge project and it took my two days to overview controls to determine text to be translated and I should do it all over now.
>
> my questions are:
> 1- is rescanning controls can lead to the situation I described?
> "Restore from database" option didn't load the controls tab after the IDE crashes,so I used "rescan with source code" option as you suggested(please look at your first answer in the topic)
> 2- is there a way to recover my work via ml_temp_xxx.xml?
>
> I already loose a lot of time, so please help me urgently.
>
> thanks in advance.

Can you tell me how large the project database file ProjectName_ml.xml is?

I think the problem may be, that my handling of the project database uses too much memory. I am working on a solution to this problem, but I think that it will still take a few days.

Phil

Hi Phil,
MyACenter_ml.xml is 9921 kb.
ml_temp_ControlsScan.xml is 15783 kb
ml_temp_SourceScan.xml is 95791 Kb.
Melike

Germany

Hi Melike,

I have just uploaded a new version (4.7x.0116) with a new (optional) implementation of the project database using an SQL Server Compact database file. I have written about this version in a separate the forum posting Project database as SQL Server Compact database.

Can you please try using this format?

You can select it via the second tab on the project properties dialog.

In this new implementation, I do not load the complete project database into a dataset. Instead, I always make queries against the database. My hope, is that this solution will be more scalable.

Actually, I don't really believe that this will help, but I would like you to try it.

Best regards
Phil


Hi,
I started to overview controls tab, I want to ask you something that can simply ease my job.
Is there an option "Deselect property "PROPERTYNAME" eveywhere" like "Hide property "PROPERTYNAME" eveywhere"?

Germany

> Hi,
> I started to overview controls tab, I want to ask you something that can simply ease my job.
> Is there an option "Deselect property "PROPERTYNAME" eveywhere" like "Hide property "PROPERTYNAME" eveywhere"?

Yes, use the right mouse button on the check box. There should be a command in the context menu.

I will reply to your other posting very soon. I haven't had any time yet.
Phil