control and designer suport

G

Guest

VS2003.NET (2005 Beta2 was too instable yet and release version is not yet
sold in Europe) and Designer support for custom controls:

I have a basic control w/ designer support up and running per Henry Tan's
codeproject sample and the article in Microsofts knowledge base.
However I need to get another DLL/assembly which is non system runnig inside
my control and during design time and that's where I am stuck presently.

How is the mechanism for the designer to use those dlls once for CE/NETCF
and one for the XP/.NET and what needs to be done? Is it the same as for the
main control DLL (so each dll would need an explicit designer version with
the attribute set? Or is it sufficient to just have the identically named
dlls in the designer subdir? Is anything else available in documentation
regarding this problem?

Thanks ahead!
tb
 
T

Tim Wilson

You indicated that the two dll's are assemblies - one built against the CF
and the other built against the full framework. I am assuming that you've
built these assemblies from the same source code, or very similar code (?).
Do you need two separate assemblies? You could build one assembly, only
using classes and members that exist in both frameworks, and compile against
the CF through a class library project type. The assembly can then be
retargeted against the full framework meaning that it will run on the
desktop. Now you'd have one assembly for the "class library" and one for the
control. Then build a design-time version of the "class library" with the
"RuntimeAssemblyAttribute" pointing to the runtime version of the "class
library", and then build the design-time version of the control referencing
the design-time version of the "class library". In short, the runtime
version of the control should reference the runtime version of the dll and
the design-time version of the control should reference the design-time
version of the dll. This will ensure that the designer has the assemblies it
needs and VS also has the assemblies that it needs to deploy to the
device/emulator. Then when you add the control to the toolbox (by pointing
to the design-time version) and drop and instance on the form, two assembly
references should be automatically added to the application project - the
runtime control and the runtime "class library".

You're going to love VS 2005 as this type of situation becomes much simpler
to handle.
 
G

Guest

Tim, thanks - that was really helpful. Together with
http://www.intelliprog.com/articles/index.html
I finally now got it to work, there was a bunch of different quirks to get
around for a c# newbie, however I got the concept and have my logger.dll
working from inside the control, yeah!!

I am still fighting a bit that in order to update the control dll I need to
shut down VS as the designer is keeping the file open. Is there any trick to
get around this and replace a designer dll while VS is going?

Thanks again and ahead!
Theo
 
T

Tim Wilson

I am still fighting a bit that in order to update the control dll I need
to
shut down VS as the designer is keeping the file open. Is there any trick to
get around this and replace a designer dll while VS is going?
As far as I know, no. The designer "locks" the assembly. I'm not sure if you
need to shut down VS or just close the solution and reopen it. Try closing
the solution, but if that doesn't work then you'll need to close VS. What
I've done in the past is write a batch file that, when run, compiles all the
required assemblies, copies them to the appropriate directories, and then
opens my test application in VS. Then all I need to do is close down VS and
then run my batch file... it just minimizes the steps required in the
process.
 
G

Guest

So it seems I need to live with that. I have the control and the designer
version now fully integrated inside VS with two projects from the same root
working on the same sources and as long as I shut down the designer before
and then restarting VS I can do the complete compile and continue. It's a bit
nasty as I am debugging on the target that is locked by the designer; well -
seems tough luck.

Anyhow, not bad for today and thanx again!

Btw: How is VS2005 in the first release - similar stability as 2003 has or
still to wait for? My Beta experience of June this year (I think that was
Beta2) was of such kind that I removed 2005 completely from my machine.

Theo
 
T

Tim Wilson

Btw: How is VS2005 in the first release - similar stability as 2003
has or still to wait for? My Beta experience of June this year
(I think that was Beta2) was of such kind that I removed 2005
completely from my machine.

I'm using the VS 2005 Team Developer build and I haven't had any problems
with it. I'm in the process of porting OpenNETCF controls to the new
designer paradigm and it seems ok so far. If you find that you do a fair
amount of custom control development then VS 2005 is a lot nicer in this
regard.
 
G

Guest

I'll give it a try!
Thanks again!
Theo


Tim Wilson said:
I'm using the VS 2005 Team Developer build and I haven't had any problems
with it. I'm in the process of porting OpenNETCF controls to the new
designer paradigm and it seems ok so far. If you find that you do a fair
amount of custom control development then VS 2005 is a lot nicer in this
regard.
 

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