Visual basic workflow compilation error

I have never received this error before, it happens when I am trying to convert a date format to a mm/dd/yy format. This function worked fine in my old version of studio but after upgrading it now fails.

Hi,

Double quote in your string seems not " (0x42) but .
So can you try to copy the following string as it is, and paste it instead of current string.

DateTime.Now.ToString("MM/dd/yy")

Note: as mm means minute, the above string is used MM (Month)

Regards,

my keyboard only has one type of " I am not sure how to change it? even if copying and pasting, why would it work fine in the old version of studio and fail after upgrade? (with the exception of the MM part, that was a typo on my part.

Hi,

In windows legacy, it seems double quote is normalized and any double quote characer is accepted. However, at this time, in windows (.net6) ,in fact, only " (0x22) is accepted to express string literal. To make matter worse, it seems to occur only compiling. (Expression validator don’t raise an alert.)

FYI, the following is sample for reproducing. The first Assign uses " 0x22 and second Assign uses and it fails in compiling.

Sample20221013-2.zip (2.1 KB)

Regards,

7 Likes

I’m having similiar problems with the following script, which worked in legacy but now breaks in Windows without triggering the validator:

New datetime(now.Date.Year, now.Date.AddMonths(1).Month,1).ToString

though no double quotes so I’m not sure what’s happening but it seems like there are some differences here that are really throwing off my migrations out of legacy

Hi @Pangloss

Would you mind sharing a sample xaml file (or a zip of a sample project if possible) of the legacy project that is causing this issue?
Could you also confirm that you are running the latest System activity package?

It turns out that quotation marks changed and need to be “converted” some how…

1 Like

Is there a solution for this? I use this statement all of the times and now none of my workflows can run due to this bug.

I learned to remove the “” and replace them with new ones, it seems that in thr recent upgrade the format if quotes changed and they need to be replaced. That worked for me.

Yes I understand but doing that manually will take many hours. I hope the bug will be resolved with an update.

I understand, I’m not sure there’s a solution, shy of opening the xml file and doing a find and replace?

2 Likes

I belive your proposal is currently the best workaround.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.