Click here to Skip to main content
15,903,854 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The following line gives an error saying it doesn't exist in the current content.

Interaction.InputBox("Enter Version", "", "default");



I don't understand why it creates problem. I am using Visual Studio 2019

What I have tried:

I read other questions about this I did every possible way;

Added reference to Microsoft.VisualBasic from project add section, also included;

using Microsoft.VisualBasic;

I also tried to add assemlies but they can not be seen, when I click add reference, all I see is Microsoft.VisualBasic option
Posted
Updated 19-Jul-19 4:29am
v3
Comments
F-ES Sitecore 19-Jul-19 10:25am    
You probably can't add references to VB projects from C#. Find out the c# equivalent and use it.
Danny96 19-Jul-19 10:29am    
Everyone used those for C# they claim it works for them, it should be work for me too

1 solution

First off, why are you using old fashioned VB junk from 2002 and earlier? That what the VisualBasic namespace is there for: to let VB6 programmers "move up gently" to .NET - it isn't meant to be used in "real applications".

You can use it, but adding a reference isn't enough - you also need to add the line:
C#
using Microsoft.VisualBasic;
(As you are prompted at the line the error is on)

But stop using it, please. Throwing together a string input form takes what? 2 minutes, tops? And then you get the basis of a much more flexible validated input form that you can use in multiple applications...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900