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

Multi-Language Add-In for Visual Studio


Error in Multi-Language Add-In for Visual Studio.NET

What is this error!!?

Version : 4.65.0081

Exception: System.Argument.Exception


Description : ResX file Type Janus.Windows.CalendarCombo.DateFormat, Janus.Windows.CalendarCombo.v3, version=3.5.0.0,
Culture=neutral, PublicKeyToken=21d551511 in the data at line 238, position 4 cannot be located. Line 240, position 5. cannot be parsed.



Stack Trace : at System.Resources.ResXResourceReader.ParseXml(XmlTextReader reader)
at System.Resources.ResXResourceReader.EnsureResData()
at System.Resources.ResXResourceReader.GetMetadataEnumerator()
at MultiLang.modResXUtil.QuickIsLocalizable(clsFormOrControl foc) in D:\MultiLang.NET\ML_2005_NewGrid\MultiLang\Modules\modResXUtil.vb:line 1044
at MultiLang.modResXUtil.SetLocalizableFoc(clsFormOrControl foc, Boolean NewState) in D:\MultiLang.NET\ML_2005_NewGrid\MultiLang\Modules\modResXUtil.vb:line 1076
at MultiLang.ctlToolWindow.StoreDirtyLocalResources(clsProjectItemArray ResxPitArray, Boolean CloseProblemDesigners) in D:\MultiLang.NET\ML_2005_NewGrid\MultiLang\Controls\ctlToolWindow.vb:line 19764
at MultiLang.ctlToolWindow.StoreDirtyResources(Boolean CloseProblemDesigners) in D:\MultiLang.NET\ML_2005_NewGrid\MultiLang\Controls\ctlToolWindow.vb:line 20922
at MultiLang.ctlToolWindow.SelectOrDeselectControlsNodes(Boolean NewState, List`1 Nodes) in D:\MultiLang.NET\ML_2005_NewGrid\MultiLang\Controls\ctlToolWindow.vb:line 17097
at MultiLang.ctlToolWindow.tgv_TreeGridCellImageClick(Object sender, TreeGridCellImageClickEventArgs e) in D:\MultiLang.NET\ML_2005_NewGrid\MultiLang\Controls\ctlToolWindow.vb:line 18020

Thank You.

Germany

Hi

The Add-In has opened the resx file for your component using the ResXResourceReader class. It wants to read the meta data using GetMetadataEnumerator(), so it can determine whether the Localizable property has been set for the Form or UserControl.

An error is thrown in the function GetMetadataEnumerator() indicating a problem in the resx file, specifically at line 240, column 5.

If you know which component was being handled, can you open the resx file in a code editor and look at line 240? Is there anything suspicious on this line? Maybe you could send me a copy of the resx file.

I have just downloaded a trial version of the Janus WinForms Controls Suite v3.5 and will do some testing with it. Assuming that there are some sample programs, I will use these to test the Add-In.

If I find any problem, I will reply again.

Phil

Germany

Hi,

I have tried this out with the CalendarCombo sample.

If the Localizable property is set for a form or UserControl, then all localizable properties are stored in the resx file.

If you define the DateFormat property, it also is stored in the resx file. I have something like this in the resx file:

<assembly alias="Janus.Windows.CalendarCombo.v3" name="Janus.Windows.CalendarCombo.v3, Version=3.5.107.0, Culture=neutral, PublicKeyToken=21d5517571b185bf" />
...
<data name="calendarCombo1.DateFormat" type="Janus.Windows.CalendarCombo.DateFormat, Janus.Windows.CalendarCombo.v3">
  <value>DateTime</value>
</data>

You have a slightly different version (3.5.0.0) but I presume that you have similar code.

The error message indicates that the ResXResourceReader class cannot locate the DateFormat type. Most likely it cannot locate the CalendarCombo type either.

This looks like some kind of registration problem. I think that the CalendarCombo component should be registered in the global assembly cache (GAC). If you know what you are doing, you can try to locate this component and register it by hand. Otherwise I would try reinstalling the Janus Controls Suite.

Phil

Germany

Hi,

finally, I think I have a solution for this problem.

The class ResXResourceReader has a constructor which takes an ITypeResolutionService parameter. It is possible to get a project specific type resolution service from Visual Studio, which resolves types using the assemblies referenced by a given project. The Add-In now fetches this interface and provides it as a parameter to the ResXResourceReader class.

Surprisingly, it seems that the Visual Studio type resolver is tolerant of incorrect version numbers, assuming there is a reference to an assembly with the same name in the project.

Phil