OrchardCoreContrib/OrchardCoreContrib.PoExtractor

PoExtraction.OrchardCore throws System.ArgumentException

ArieGato opened this issue · 16 comments

Hi,

when I use the PoExtractor for OrchardCore I get an exception for liquid templates. I used the following command to install:

dotnet tool install --global PoExtractor.OrchardCore --version 0.2.0-rc1

To determining the cause of the issue I cloned the PoExtractor repo and upgraded all packages. Same error keeps occuring. Then I tested on a Module of OrchardCore. The issue also occurs in the OrchardCore.Menu module.

The file that causes the issue is: /Views/LinkMenuItemPart.Admin.cshtml

Contents:

@{
    LinkMenuItemPart part = Model.MenuItemPart;
}

<span>@part.Name <code>@part.Url</code><span class="text-muted">- Link</span></span>

System.ArgumentException: 'An item with the same key has already been added. Key: functions'

Hope you can take a look at it.

Thnx,
Arjan

@ArieGato is this still happening?

Yes the issue still occurs.

Could you please provide me a repo to reproduce the this issue or at least a class or a view, coz frankly I'm not sure if the 0.2.0-rc1 is the latest version

sure, although I tested it with the latest version of the dev branch.

Please refer me to the cs file or the view that causes the issue, I will do a unit test to make sure if there's a bug

I forked the repo here: https://github.com/ArieGato/PoExtractor

To reproduce:

  1. adjust tje launchsettings to point to your OrchardCore solution
  2. create a c:\temp\test folder
  3. run the PoExtractor.OrchardCore

Now wait until the exception occurs. Some modules will be processed correctly.

I will check ...

That means if I run the PoExtractor on OC source some errors will show up?

yes, it should. In my case it happened at the OrchardCore.Admin project on the view AdminDashboard.cshtml.

Let me have to the AdminDahsboard.cshml first before I run it

Nothing strange on that view .. time to run the tool

I just found one error

Error

This is not ArgumentExceptions?

did you use my repo to test?

No worry, I will debug

did you use my repo to test?

Nope, but the OC version may different from mine, I need to test it against the latest bits of the dev branch