4 Replies - 3939 Views - Last Post: 21 October 2012 - 11:34 AM Rate Topic: -----

#1 Drowjam  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 33
  • Joined: 16-October 12

C# how to reference a class library.

Posted 20 October 2012 - 08:27 PM

I'm just starting out in c#. I'm currently wanting to use some classes libraries I built in vb how can I reference them. Also I want to reference libraries im making in c# how do I test them do I need start a new project. Or can I add a form or something and. Set it as the starting point 4 the project
Is This A Good Question/Topic? 0
  • +

Replies To: C# how to reference a class library.

#2 Drowjam  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 33
  • Joined: 16-October 12

Re: C# how to reference a class library.

Posted 20 October 2012 - 08:42 PM

View PostDrowjam, on 20 October 2012 - 08:27 PM, said:

I'm just starting out in c#. I'm currently wanting to use some classes libraries I built in vb how can I reference them. Also I want to reference libraries im making in c# how do I test them do I need start a new project. Or can I add a form or something and. Set it as the starting point 4 the project

Also would the refence to a vb library work in an xna project 4 360. I'm making agame starting point $300 dollars on books.
Was This Post Helpful? 0
  • +
  • -

#3 MrShoes  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 312
  • View blog
  • Posts: 488
  • Joined: 13-June 12

Re: C# how to reference a class library.

Posted 21 October 2012 - 02:24 AM

If your class library has been compiled to dll, it's very easy. When you right-click a project in VS, select Add Reference, then Browse, and navigate to the dll. A VB Class Library should work.

To test your classes, I usually create a TestBench project that I can run separately and see how things work.
Was This Post Helpful? 0
  • +
  • -

#4 Michael26  Icon User is offline

  • DIC-head, major DIC-head
  • member icon

Reputation: 359
  • View blog
  • Posts: 1,530
  • Joined: 08-April 09

Re: C# how to reference a class library.

Posted 21 October 2012 - 03:50 AM

And don't forget to add Using Your-library-name; in the code.
Was This Post Helpful? 0
  • +
  • -

#5 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5537
  • View blog
  • Posts: 11,868
  • Joined: 02-June 10

Re: C# how to reference a class library.

Posted 21 October 2012 - 11:34 AM

I would also point out that Solutions can contain more than one project, and they don't all have to be in the same language.

Since these libraries you are talking about are your own creation, you could just add them to your new solution.

I think most libraries by most rookies are never really 'done'. Each time a new program is written the need for a new method that would go in the library comes up. So why go through all the bother of having to open the library project, make changes, compile it, update the DLL and so on? You can have those library projects open in your solution and work on them in real time along with your main program. When you need a new library method you just add it.

Attached Image
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1