After Convert to WIndows and Remove namespace: chr(34) doesn't work anymore

Components/MailProcessing/SendExceptionMail.xaml: Compiler error(s) encountered processing expression “mailitem.Subject.Replace(CHR(34).toString, “”)”.(2) : error BC30451: ‘CHR’ is not declared. It may be inaccessible due to its protection level.
(2) : error BC30451: ‘CHR’ is not declared. It may be inaccessible due to its protection level.

I have converted my process from Windows Legacy to Windows.
Afterwards i have removed unused imports, because it was recomended by the studio.
Now i have the issue that i cannot use ascii characters with the CHR function anymore and i do not know how to get the function back. I need to have it.

Hi,

For now, can you try to add Strings. like Strings.Chr(34) ?

Regards,

Hi Yoichi,
i sadly don’t have Strings only String and chr is not a Method of String.
Is there something i can import that adds strings?

Regards,
Ben

Hi,

If you use the latest Studio. automatic recovery may work when restart Studio and reopen the project. Can you try this?

Regards,

Hi,

i have restarted the studio and the whole vm client. The issue is still the same. :frowning:

Regards,
Ben

Hi,

Can you check If there is Microsoft.VisualBasic in Import tab? if there isn’t, can you add it?

image

Or try

Microsoft.VisualBasic.Strings.Chr(34)

If Microsoft.visualBasic cannot be added, can you check if there is the following element under <sco:Collection x:TypeArguments="AssemblyReference"> in your xaml file using text editor?

If there isn’t, can you add the following element?

  <AssemblyReference>Microsoft.VisualBasic</AssemblyReference>

Regards,

@Ben_Ten

Can you try this fullnamespace

Microsoft.VisualBasic.Strings.Chr(var)

Cheers

Hi @Ben_Ten,

Could you, please, specify which version of Studio you used when encountering this issue?
I’ve tried reproducing this in my setup with Studio 23.4.3 released version and I did not replicate the error. After converting from Windows-Legacy to Windows, the CHR method worked as expected.

Best Regards!

It would also help if you could upload your initial project (the windows-legacy one)

Thank you