Add User Control to Project (VS2005 Beta 2)

Mark Wills

Member
Joined
Jul 11, 2004
Messages
13
Location
Worldwide
Programming Experience
10+
Hello, this is my first post.

I am trying out Visual Studio 2005 Beta 2 and am very happy with it. It seems to be quite stable (so far) - I can't wait for the full release!

I have developed a user control as a project, and it works well. When I run the project, Visual Studio launches it inside a small utility called User Control Test Container. Everything seems to work fine. The project produces a DLL.

Now, I want to start a second project that uses my User Control. However, I can't work out how to include this user control in my new project.

In earlier versions of .Net, one had a 'Solution' and could create projects within the solution, but this seems to be missing in Beta 2, or is it just hidden somewhere?

When I open a new project, I go to the Project Menu, and click on Add Reference, but I cannot see my user control anywhere in the lists... What do I have to do to make my control appear? It was easy in VB6, you just compiled it and was registered as a COM component!

Is this something to do with the 'Global Assembly Cache'? I have heard about this, and I presumably have to tell the GAC about my user control somehow. Could someone please provide some pointers. Any help gratefully received.

Many thanks
 
I've got beta 2 of VB 2005 Express and I doubt that that is less functional than the VS beta. I still get a solution in the Solution Explorer, which I can right-click and select Add then New Project or Existing Project. Having said this, if you want to use that UserControl in other solutions then you should keep it in a seperate solution anyway. The Add Reference dialogue has a Browse tab, which allows you to navigate to the DLL output by your other project.
 
Hmmm...

Hi there, thanks for the reply,

Yes, I have found the browse tab and can navigate to the DLL and include it in my project, BUT, it does not appear in the toolbox, thus I cant drag it onto my form.... Normally, when you include a user control in your project, it appears in the toolbox... Any ideas?

Mark.
 
Doh!

Bugger!

I can't believe it was simple. Doh! How stupid do I feel :(

Seriously though, thanks for your help. It worked a treat.

I have another problem now - the user control uses My.Settings to access a DB connection string to SQL server - however, when running in a windows form, it doesn't connect... I would have thought that the My.Settings in the usercontrol (given that it is a seperately compiled project to the windows form project) would inherit it's own My.Settings, not the My.Settings of the Windows form projects... Not sure... Will check that one out - If I get stuck I'll post in one of the programming forums.

Once again, thanks for your help - I'm coming at VB.Net as an experienced VB6 programmer, but it's still quite a brain squleching experience... Deliberately didn't bother with .Net 1.0 & 1.1, as I thought it would take some time to mature - Seems they've really got it together in .Net 2.0 - For me, the big improvement is they include a serial port control - as a SCADA programmer, it's kind of important!

Many thanks, have a good one.

Mark.
 
Hi!

Did you resolve this? It would just be interesting to know the solution.

Regards,
Pace
 
Back
Top