
Signature
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Jeffrey,
Thanx for the quick reply. However, that's not what I was asking. I
essentially do what you're suggesting already (although I tend to use a
try/catch block wrapping creation of the designtime-only objects;
DesignMode isn't sufficiently reliable, IMHO).
What I'm really interested in is whether there's a different design
pattern from distributing the designtime library but blocking any of it
from running at run time. In other words, right now I have to
distribute an assembly DLL that I never want called at runtime. This
strikes me as ugly.
Does anyone know of any other design patterns that can be used to deal
with the need to segregate designtime code?
- Mark
> Hi Mark,
>
[quoted text clipped - 24 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
Frank Hileman - 17 Feb 2005 18:31 GMT
Hello Mark,
Yes, most design-time attributes that reference design-time classes can use
a string containing a fully qualified class name instead of a class
reference. For example, DesignerAttribute, EditorAttribute. If you use this
mechanism you will need to install the main run-time assembly in the GAC,
otherwise VS may load your assembly twice using its internal LoadFrom code,
causing type errors. Finally you may also separate some of your EnvDTE code
into an assembly that references your run-time assembly, instead of
vice-versa. This might require a redesign, but the string based attributes
will help.
Regards,
Frank Hileman
check out VG.net: http://www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor
----- Original Message -----
Newsgroups: microsoft.public.dotnet.framework.windowsforms.designtime
Sent: Thursday, February 17, 2005 10:03 AM
Subject: Re: Separating Design-Time Capabilities from Run Time
> Jeffrey,
>
[quoted text clipped - 13 lines]
>
> - Mark
"Jeffrey Tan[MSFT]" - 18 Feb 2005 02:40 GMT
Hi Mark,
Thanks for your feedback!!
DesignMode property should be reliable except that it will not return the
correct value in component class' constructor.
Frank's way of retrieving types from GAC is another choice, but I think it
requires extra work of installing assembly in client's machine. However,
you may still separate the design-mode code in another assembly. Thanks
Best regards,
Jeffrey Tan
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Frank Hileman - 18 Feb 2005 02:59 GMT
Hello Jeffrey,
It is not necessary for the assembly to be installed on the client's
machine, unless the client is using the design-time assemblies in Visual
Studio .NET. This is a Visual Studio .NET problem and not specific to the
problem in general. It appears that non-GAC assemblies were not considered
or tested during the Visual Studio .NET design, except in the case where the
design-time types (designers, etc) were embedded in the same assembly.
Regards,
Frank Hileman
check out VG.net: http://www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor
> Hi Mark,
>
[quoted text clipped - 9 lines]
> Best regards,
> Jeffrey Tan