User control but not from toolbox

K

Kevin Mellor

Hello all,

I hope someone can help me. I am not new to developing but am new to
C# (assemblies etc) and V Studio 2003, although familiar with
terminology from VS6.

I am in the nightmare scenario of picking up half written code
without comments. This is what I have done.


The original 'Solution' contained only 1 project and several
references to 'Release' build assembly files. This was no good as I
couldn't step through the code in the debugger.

So I added the projects containing the source for the references to
the solution and then recreated the references as project references.

So far so good, I can now step through the code.

But now for some reason (maybe it was something I did, I am not sure)
my dialog boxes which contain user controls (these user controls being
made in the additional projects I previsouly mentioned) no longer have
these user controls - I thnk VS in it's wisdom removed them.


This is my problem:-
I understand that to drag and drop these controls back onto my dialog
box I do so from the toolbox. But they are not on the toolbox.

I also understand I can add the built assemblies to the toolbox so I
then can drag and drop them onto my dialog. But I am sceptical.
These controls are now a part of my solution. If I never store the
built binaries and only the source, how would a fresh source safe
retrieval populate the toolbox with my user controls again? And how
would I ensure debug code was used for a debug build and release code
for a release build if I explicited added a release binary to the
toolbox?

I hope that makes sense.

I think, in other words, what I would like to do, is add the project
to the toolbox so it knows if to use release of debug, in the same way
you add a project reference.

Any thoughts on this would be greatly appreciated.

Thanks in advance.
Kevin Mellor
(e-mail address removed) (e-mail accepted but prefer reply to post so others
can benefit)
 
J

Jediah L.

Kevin,

Are the controls still there at runtime? Is the source code still valid (it
compiles).

The developers on my dev team have been struggling with these types of
issues each time the external assemblies which contain referenced user
controls are recompiled (the incremented version numbers of the new DLL's
seem to throw off the design mode of VS.Net).

One thing I might suggest is, close down your project - and go into the
bin/debug or bin/build directories of the project with the dialogs that no
longer want to paint in the IDE - and delete all the DLL's. Then reopen the
project and rebuild all - forcing the projects DLL versions to be rebuilt
and copied local to the run directory again.

We have found while diagnosing similar problems that the DLL's get locked
when they are being displayed in the IDE - and then a 'rebuild' will not
copy the new DLL's to the bin/debug or bin/release directory - leaving you
to think new copies were posted into those directories - but they aren't -
and the out of synch versions cause them to be undisplayable in the IDE.
 
K

Kevin Mellor

Jediah,

many thanks for your reply. Sadly it does not easily solve my
problem but has certainly given me some things to try out and think
about.

If I were to do what you suggest - when adding controls to the
toolbox should I add the locally copied Release build references to
the toolbox. If so, what then if I wish to debug.

Does anyone know what the problem actually is here. I find it hard
to believe that this is an oversight on Microsofts part. Is it more a
case of what I am trying to do is "wrong" in the context of .NET
development.

Regards

Kevin
 
K

Kevin Mellor

Finally I have begun to make some progress.

I hope this does not sound patronising but I have discovered that in
the situation I described above, the controls in the other projects
should have been made available in the toolbox automatically under the
title "My User Controls".

This did not happen, and there are a few threads about this already so
I won't duplicate my questions here.

Although what is frustrating is to get the My User Controls to
recognise my code I had to delete my sources from the projects, readd
the sources to the project, and then cut and paste my original files
over the ones the wizard created.

If anyone can point me in the direction of some useful resources, or
if anyone has an answer/fix/workaround for this problem, please let me
know. Any suggestion welcomed.

Regards

Kevin Mellor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top