cancel
Showing results for 
Search instead for 
Did you mean: 

Microsot.VisualBasic.Strings is a type not namespace

Anonymous
Not applicable
Hi guys,

Have added Microsot.Visualbasic.dll at External Reference into the Code Options tab and Microsot.VisualBasic.Strings at Namespace Imports and i get this error ==> "Microsot.VisualBasic.Strings is a type not namespace". 

If i remove the Strings from the namespace and leave only Microsoft.VisualBasic then i got 200 errors.

What should I do to bypass this issue.

Into the Global Code I have a lot of C# code.

thank you for your answer!


------------------------------
Cohen
RPA Developer

Romania
------------------------------
8 REPLIES 8

dmma
Level 5
Hi Cohen, 
It looks like you have spelling error in namespace, but maybe its only in this post, pls double check that: is Microsot.VisualBasic or Microsoft.VisualBasic

Maybe this is the reason.

But probably, you need to write in the namespace only Microsoft.VisualBasic without Strings. As Strings is a class name, not a namespace.

Here is the reference on MSDN:

https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualbasic.strings?view=netframework-4.8

Let me know if that solved the problem.


------------------------------
Kind regards,

Dmitrij Mamajev
RPA Developer
Volvo Cars
Gothenburg - Sweden
------------------------------
Kind regards, [FirstName] [LastName] [Designation] [JobTitle] [CompanyName] [City] [State] [Phone]

Anonymous
Not applicable
Spasibo balshoie Dmitry! It did the trick! had a typo out there!

------------------------------
Cohen
RPA Developer

Romania
------------------------------

Hi Dmitrij, Please let me know your thoughts.
I have added both the DLL name and Namespace correctly but still getting this Error Message:

''Page: Initialise
Stage: Stage1
Type: Error
Action: Validate
Description: Compiler error at top section line -5: Metadata file 'Microsoft.VisualBasic.Core.dll' could not be found
Repairable: No"

 

31548.png



------------------------------
Soumya Behera
------------------------------

Try without referencing the dll. Just use the namespace import you have for 'Microsoft.VisualBasic', and see if that works.

------------------------------
Dave Morris
Cano Ai
Atlanta, GA
------------------------------
Dave Morris 3Ci at Southern Company Atlanta, GA

Hi Davis, Tried your way.

But now I am getting new error that is saying "Page: Action 1
Stage: Code1
Type: Error
Action: Validate
Description: Compiler error at line 2: The name 'Mid' does not exist in the current context
Repairable: No"

If do not mind can you please tell me how I can get Microsoft.VisualBasic.Core.dll so that I can put it in my "Blue Prism Automate" folder.

and do you know the Difference between "Microsoft.VisualBasic.Core.dll" &  "Microsoft.VisualBasic.dll". Because I have also tried using the second DLL file but still getting the same error.

31560.png



------------------------------
Soumya Behera
------------------------------

Could you show a snippet of your C# code?

------------------------------
Dave Morris
Cano Ai
Atlanta, GA
------------------------------
Dave Morris 3Ci at Southern Company Atlanta, GA

Hi Davis, I was trying to do use some prebuilt visual basic funtionsin code stage like MID(), Trim(), etc.

31578.png

------------------------------
Soumya Behera
------------------------------

Why do you even need VB methods in C# code?
Left/Right/Mid => Substring, Instr => IndexOf, Trim is same.

C#: value = SText.Substring(SText.IndexOf(TextToSearch),4).Trim();

------------------------------
Andrey Kudinov
Project Manager
MobileTelesystems PJSC
Europe/Moscow
------------------------------