I am completely new to using Visual Studio 2013 Ultimate and C# and I am trying to figure out how to simply import a class that exists in another project into my console application.
I have another project named Project1
that contains a CreditCard.cs
file. I have tried the following for importing the CreditCard
class:
using Project1.CreditCard
Can anyone please point me in the right direction or tell me how I might import a class in C#?
File>New>Project From Existing Code... Choose Visual C++ then click Next. Set Project File Location to something OTHER than C:\Users*yourUserName*\Documents\Visual Studio 2013\Projects. Use the Add button to add the source tree.
You right click on the project (not solution) that you want having the reference. So click on your new project, choose Add | References --- then in the dialog, choose Solution on the left, and find your CreditCard project and add it. It'll add the reference, and you can then use the Using in your code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With