GetFileNameWithoutExtension' is not a member of 'String

Hello people i am creating multiple word files to pdf automation project
It was working fine till now and suddenly without changin anything now this error is coming which i am not able to resolve Can someone please help me out regarding same.

Error ERROR Validation Error Compiler error(s) encountered processing expression “Path.GetFileNameWithoutExtension(item)”.
‘GetFileNameWithoutExtension’ is not a member of ‘String’. Main.xaml

Hi @rahul.kharapkar

Just to clarify, have you created a variable named path of type string in your project?

Thanks


Yes i did , can you help me out here

@rahul.kharapkar yes that’s why the error occurred, change the variable name to paths or strPath as instead of taking the reserved keyword path (which contains getfilenamewithoutextension method) it takes Variable path(which don’t have that method).

There are lots of post similar to this one(all the solutions are also same ) please refer,

Thanks

Thank you it got resolved but now new error is coming at input dialog box can you help with same

@rahul.kharapkar can you remove the variable and enter again and see if the error comes…

Similar to this post please refer,

Thanks

Hello, Yes reinitialising variable worked, Thanks

1 Like

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