Nameof is not defined or is inaccessible

I have a throw activity with the following in the exception field:

new ArgumentNullException(nameof(username))

UiPath is keen to throw an error saying “‘nameof’ is not defined. It may be inaccessible due to its protection level.”

After speaking with a member of the Microsoft corefx team, he came up with a possiblity as to why:

I’d be willing to bet they are resolving the MSBuild in C:\Windows\Microsoft.NET\Framework\v4.0.30319 which is pre-roslyn

Is there a way we can control which version of msbuild UiStudio uses so that we may take advantage of C# 6/roslyn/other tech?

1 Like

Hi @Foxtrek_64

Until some improvements are done, expressions containing the nameof() operator are marked as invalid and are not allowed.

This (and some other, related bugs) will be fixed in future releases.

1 Like

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

Just as an update -> this now gives a better error message before we add support for the new features:

1 Like