4 Replies - 9865 Views - Last Post: 02 December 2012 - 10:48 AM

#1 Ap0C552  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 318
  • Joined: 08-December 10

Visual studio new class

Posted 01 December 2012 - 12:44 PM

Hi,

I want to import some classes I wrote from one windows forms project to another.

I thought I could just take the class file and move it into the appropriate position in the other project. But for some reason the new class will no show up in the solutions explorer.

I hit rebuild project and nothing shows up.

Does anyone have any suggestions on this matter?


Thanks!
Is This A Good Question/Topic? 0
  • +

Replies To: Visual studio new class

#2 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1362
  • View blog
  • Posts: 3,002
  • Joined: 30-January 11

Re: Visual studio new class

Posted 01 December 2012 - 12:58 PM

When we say 'move' what are you really saying?

Also how many class files are we talking about here?
Was This Post Helpful? 0
  • +
  • -

#3 tlhIn`toq  Icon User is offline

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

Reputation: 5581
  • View blog
  • Posts: 11,934
  • Joined: 02-June 10

Re: Visual studio new class

Posted 01 December 2012 - 01:32 PM

in your target (new) solution...

Right-click on the project.
Choose add existing...
Navigate to the file(s) you want to import
select them
You can then either add and they will be copied to the new solution, or click the little triangle and choose add as link and they won't be copied just linked to.

The advantage of a link is that if you make improvements then any other project using those same files will see the updates the next time the project is opened. I often do this when building up a namespace or DLL but I know its not complete.
Was This Post Helpful? 0
  • +
  • -

#4 Ap0C552  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 318
  • Joined: 08-December 10

Re: Visual studio new class

Posted 01 December 2012 - 02:25 PM

Cheers. :)
Was This Post Helpful? 0
  • +
  • -

#5 Ap0C552  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 318
  • Joined: 08-December 10

Re: Visual studio new class

Posted 02 December 2012 - 10:48 AM

When I import the classes into my project, they show up in the solutions explorer.

But when I try to instantiate an instance of one of these classes, they are not recognized...

EDIT:

I had to change the namespace on the top of each class.

This post has been edited by Ap0C552: 02 December 2012 - 10:56 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1