Question

I am still learning c# and have been following a tutorial where I use Visual Studio to connect MySQL. I want to compile the file using csc on the command line this time and error cs0246 came out6 where its ays "The type or namespace name 'MySqlConnection' could not be found (are you missing a using directive or assembly reference?)".

I am just using the command "csc MyFile.cs". I know that I should be using some form of directive but I'm not sure how to use it? In Visual Studio, all I have to do is add the MySql.Data and MySql.Data.Entity into the Reference under the project. How do I use the csc command?

Was it helpful?

Solution

csc /? contains all answers... Also covered in Working with the C# 2.0 Command Line Compiler.

Will be something like (not sure what is the name/path of assembly you need to link):

csc /reference:MySqlConnection.dll MyFile.cs
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top