Segregating designtime from runtime

Discussion in 'ASP .Net Building Controls' started by General Chaud Caliente, Oct 17, 2003.

  1. I am working on a .NET component library and I am trying to figure out
    how to segregate designtime code from the runtime assembly. Delphi made
    this easy.

    My natural inclination is to put all of the designtime source files into
    their own namespace and drop them into a sub-folder under the main
    source folder. Then create a design project which contains all of the
    runtime code, as well as all of the designtime code. The runtime
    assembly would be called whatever.dll and the designtime assembly would
    be called design.whatever.dll. All of that is easily done.

    The problem is instructing the compiler to substitute the runtime
    assembly for the assembly which was used at compile time.

    In the compact framework, there is an attribute called "RuntimeAssembly"
    that instructs the compiler to deploy another assembly to the device.
    This is absolutely necessary in the compact framework, but also
    desirable in the full framework.

    If anyone out there has an idea on how to target a different assembly at
    runtime, I'd sure be happy to hear about it.

    --
    With Regards,

    General Chaud Caliente
    www.ScaryShark.com

    Note: My email address is spam proofed. Replace _spam@proofing_ with @.
     
    General Chaud Caliente, Oct 17, 2003
    #1
    1. Advertising

  2. Hi General,

    You can't target a different assembly at runtime, but you can run certain
    code depending upon whether you are in design-time or runtime by checking
    HttpApplication.Context which will be null if you are in design-time.

    Jim Cheshire [MSFT]
    Developer Support
    ASP.NET


    This post is provided as-is with no warranties and confers no rights.

    --------------------
    >Date: Fri, 17 Oct 2003 16:45:21 -0600
    >From: General Chaud Caliente <gcc_spam@proofing_scaryshark.com>
    >Reply-To: gcc_spam@proofing_scaryshark.com
    >Organization: Scary Shark Limited
    >User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b)

    Gecko/20030723 Thunderbird/0.1
    >X-Accept-Language: en-us, en
    >MIME-Version: 1.0
    >Subject: Segregating designtime from runtime
    >Content-Type: text/plain; charset=us-ascii; format=flowed
    >Content-Transfer-Encoding: 7bit
    >Message-ID: <>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    >NNTP-Posting-Host: co-ratlsnk-u2-c6c-116.clspco.adelphia.net 68.71.60.116
    >Lines: 1
    >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
    >Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet.buildingcontrols:7812
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    >
    >I am working on a .NET component library and I am trying to figure out
    >how to segregate designtime code from the runtime assembly. Delphi made
    >this easy.
    >
    >My natural inclination is to put all of the designtime source files into
    >their own namespace and drop them into a sub-folder under the main
    >source folder. Then create a design project which contains all of the
    >runtime code, as well as all of the designtime code. The runtime
    >assembly would be called whatever.dll and the designtime assembly would
    >be called design.whatever.dll. All of that is easily done.
    >
    >The problem is instructing the compiler to substitute the runtime
    >assembly for the assembly which was used at compile time.
    >
    >In the compact framework, there is an attribute called "RuntimeAssembly"
    >that instructs the compiler to deploy another assembly to the device.
    >This is absolutely necessary in the compact framework, but also
    >desirable in the full framework.
    >
    >If anyone out there has an idea on how to target a different assembly at
    >runtime, I'd sure be happy to hear about it.
    >
    >--
    >With Regards,
    >
    >General Chaud Caliente
    >www.ScaryShark.com
    >
    >Note: My email address is spam proofed. Replace _spam@proofing_ with @.
    >
    >
     
    Jim Cheshire [MSFT], Oct 18, 2003
    #2
    1. Advertising

  3. Hi guys,

    I would highly recommend to have your design-time code implemented in its
    own assembly, i.e.:

    YourCompany.YourControls.dll
    YourCompany.YourControls.Design.dll

    instead of filling your code checking if you're at design-time or run-time.
    You'll need to deploy both files; but at run-time, the .Design assembly
    won't be used.

    Not sure why you want to mess with the compiler for this.

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    http://obies.com/vga/blog.aspx
    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
    and not by private mail.


    "Jim Cheshire [MSFT]" <> wrote in message
    news:bns$...
    > Hi General,
    >
    > You can't target a different assembly at runtime, but you can run certain
    > code depending upon whether you are in design-time or runtime by checking
    > HttpApplication.Context which will be null if you are in design-time.
    >
    > Jim Cheshire [MSFT]
    > Developer Support
    > ASP.NET
    >
    >
    > This post is provided as-is with no warranties and confers no rights.
    >
    > --------------------
    > >Date: Fri, 17 Oct 2003 16:45:21 -0600
    > >From: General Chaud Caliente <gcc_spam@proofing_scaryshark.com>
    > >Reply-To: gcc_spam@proofing_scaryshark.com
    > >Organization: Scary Shark Limited
    > >User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b)

    > Gecko/20030723 Thunderbird/0.1
    > >X-Accept-Language: en-us, en
    > >MIME-Version: 1.0
    > >Subject: Segregating designtime from runtime
    > >Content-Type: text/plain; charset=us-ascii; format=flowed
    > >Content-Transfer-Encoding: 7bit
    > >Message-ID: <>
    > >Newsgroups: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    > >NNTP-Posting-Host: co-ratlsnk-u2-c6c-116.clspco.adelphia.net 68.71.60.116
    > >Lines: 1
    > >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
    > >Xref: cpmsftngxa06.phx.gbl

    > microsoft.public.dotnet.framework.aspnet.buildingcontrols:7812
    > >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    > >
    > >I am working on a .NET component library and I am trying to figure out
    > >how to segregate designtime code from the runtime assembly. Delphi made
    > >this easy.
    > >
    > >My natural inclination is to put all of the designtime source files into
    > >their own namespace and drop them into a sub-folder under the main
    > >source folder. Then create a design project which contains all of the
    > >runtime code, as well as all of the designtime code. The runtime
    > >assembly would be called whatever.dll and the designtime assembly would
    > >be called design.whatever.dll. All of that is easily done.
    > >
    > >The problem is instructing the compiler to substitute the runtime
    > >assembly for the assembly which was used at compile time.
    > >
    > >In the compact framework, there is an attribute called "RuntimeAssembly"
    > >that instructs the compiler to deploy another assembly to the device.
    > >This is absolutely necessary in the compact framework, but also
    > >desirable in the full framework.
    > >
    > >If anyone out there has an idea on how to target a different assembly at
    > >runtime, I'd sure be happy to hear about it.
    > >
    > >--
    > >With Regards,
    > >
    > >General Chaud Caliente
    > >www.ScaryShark.com
    > >
    > >Note: My email address is spam proofed. Replace _spam@proofing_ with @.
    > >
    > >

    >
     
    Victor Garcia Aprea [MVP], Oct 19, 2003
    #3
  4. Victor Garcia Aprea [MVP] wrote:
    > Not sure why you want to mess with the compiler for this.


    Because I don't want users of my controls to deploy my designtime stuff.
    If you have my designtime stuff you can easily load the assemblies
    into visual studio and use the components to write your own software
    without having to pay me for the right to use my product.

    Designtime functionality should never be shipped to an end user.

    ever.

    That should be expressly forbidden by the license. Users of my
    component libraries (developers) have paid me for the right to use the
    product in their own creations, as well as the right to deploy a runtime
    only version of my components for their end-users.

    I am having a hard time believing that Visual Studio makes it difficult
    to separate designtime code from runtime code. This is crazy.

    --
    GCC
     
    General Chaud Caliente, Oct 22, 2003
    #4
  5. >>>> Because I don't want users of my controls to deploy my designtime
    stuff.
    If they're using your control to develop an app they will need your
    design-time stuff, period.
    The whole idea of separating runtime and designtime code is not to stop
    someone from pirating your component but to avoid the need to deploy
    designtime code with the final app (smaller final size, smaller memory
    footprint, etc)

    >>>> Designtime functionality should never be shipped to an end user.

    Let's see if we can agree on a few terms here:
    1) You = control developer
    2) Your client = page developer - building an app
    3) Your client's client = end user using the app built using your controls
    At 2) you will need to ship runtime & designtime assemblies; At 3) only
    runtime assembly will be needed. This is actually possible today, without
    doing anything special.

    >>>> If you have my designtime stuff you can easily load the assemblies
    >>>> into visual studio and use the components to write your own software
    >>>> without having to pay me for the right to use my product.

    Well, not having your design-time stuff won't stop anyone from using your
    component, they may not have a nice design-time experience, but not having
    designer-support should not stop them from deploying and using your control.
    There are other better mechanisms (which doesn't include messing with
    design-time support), i.e. a licensing scheme, to make it harder for
    unauthorized people from using your components.

    Bottom line, I think you're trying to protect your controls from piracy with
    the wrong approach.

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    http://obies.com/vga/blog.aspx
    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
    and not by private mail.

    "General Chaud Caliente" <gcc_spam@proofing_scaryshark.com> wrote in message
    news:...
    > Victor Garcia Aprea [MVP] wrote:
    > > Not sure why you want to mess with the compiler for this.

    >
    > Because I don't want users of my controls to deploy my designtime stuff.
    > If you have my designtime stuff you can easily load the assemblies
    > into visual studio and use the components to write your own software
    > without having to pay me for the right to use my product.
    >
    > Designtime functionality should never be shipped to an end user.
    >
    > ever.
    >
    > That should be expressly forbidden by the license. Users of my
    > component libraries (developers) have paid me for the right to use the
    > product in their own creations, as well as the right to deploy a runtime
    > only version of my components for their end-users.
    >
    > I am having a hard time believing that Visual Studio makes it difficult
    > to separate designtime code from runtime code. This is crazy.
    >
    > --
    > GCC
    >
    >
     
    Victor Garcia Aprea [MVP], Oct 23, 2003
    #5
  6. General,

    You need to use a license provider. Here are some links that might help
    you. The first one is probably best for your situation.

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html
    /aspnetcontrollicensing.asp
    http://support.microsoft.com/default.aspx?kbid=822680
    http://www.developer.com/net/asp/article.php/3074001

    Jim Cheshire [MSFT]
    Developer Support
    ASP.NET


    This post is provided as-is with no warranties and confers no rights.


    --------------------
    >Date: Wed, 22 Oct 2003 15:45:20 -0600
    >From: General Chaud Caliente <gcc_spam@proofing_scaryshark.com>
    >Reply-To: gcc_spam@proofing_scaryshark.com
    >Organization: Scary Shark Limited
    >User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b)

    Gecko/20030723 Thunderbird/0.1
    >X-Accept-Language: en-us, en
    >MIME-Version: 1.0
    >Subject: Re: Segregating designtime from runtime
    >References: <>

    <bns$>
    <>
    >In-Reply-To: <>
    >Content-Type: text/plain; charset=us-ascii; format=flowed
    >Content-Transfer-Encoding: 7bit
    >Message-ID: <>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    >NNTP-Posting-Host: co-ratlsnk-u2-c6c-116.clspco.adelphia.net 68.71.60.116
    >Lines: 1
    >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
    >Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet.buildingcontrols:7853
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    >
    >Victor Garcia Aprea [MVP] wrote:
    > > Not sure why you want to mess with the compiler for this.

    >
    >Because I don't want users of my controls to deploy my designtime stuff.
    > If you have my designtime stuff you can easily load the assemblies
    >into visual studio and use the components to write your own software
    >without having to pay me for the right to use my product.
    >
    >Designtime functionality should never be shipped to an end user.
    >
    >ever.
    >
    >That should be expressly forbidden by the license. Users of my
    >component libraries (developers) have paid me for the right to use the
    >product in their own creations, as well as the right to deploy a runtime
    >only version of my components for their end-users.
    >
    >I am having a hard time believing that Visual Studio makes it difficult
    >to separate designtime code from runtime code. This is crazy.
    >
    >--
    >GCC
    >
    >
    >
     
    Jim Cheshire [MSFT], Oct 23, 2003
    #6
  7. > Bottom line, I think you're trying to protect your controls
    > from piracy with the wrong approach.


    No. I am trying to find out how to separate designtime from runtime so
    that my users don't have to deploy designtime code.

    > At 2) you will need to ship runtime & designtime assemblies; At
    > 3) only runtime assembly will be needed. This is actually
    > possible today, without doing anything special.


    *NOW* we're getting somewhere...

    .... and exactly how do I do that?

    --
    GCC
     
    General Chaud Caliente, Oct 24, 2003
    #7
  8. Thanks Jim. I'll have a look.

    --
    GCC
     
    General Chaud Caliente, Oct 24, 2003
    #8
  9. >>>> No. I am trying to find out how to separate designtime from runtime so
    >>>> that my users don't have to deploy designtime code.


    Ok. Your previous post about your concern about people using your components
    without paying for them made me believe you were looking for a licensing
    solution.

    >>>> *NOW* we're getting somewhere...
    >>>> ... and exactly how do I do that?


    As I said before, there is nothing special about this; you just build two
    assemblies, one containing your control's runtime code and the other one for
    contanining their design-time stuff. If you're encountering any specific
    errors/problems while doing this, please detail them.

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    http://obies.com/vga/blog.aspx
    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
    and not by private mail.

    "General Chaud Caliente" <gcc_spam@proofing_scaryshark.com> wrote in message
    news:...
    > > Bottom line, I think you're trying to protect your controls
    > > from piracy with the wrong approach.

    >
    > No. I am trying to find out how to separate designtime from runtime so
    > that my users don't have to deploy designtime code.
    >
    > > At 2) you will need to ship runtime & designtime assemblies; At
    > > 3) only runtime assembly will be needed. This is actually
    > > possible today, without doing anything special.

    >
    > *NOW* we're getting somewhere...
    >
    > ... and exactly how do I do that?
    >
    > --
    > GCC
    >
     
    Victor Garcia Aprea [MVP], Oct 24, 2003
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chip
    Replies:
    1
    Views:
    394
  2. Mike

    Refreash DesignTime control.

    Mike, Jan 11, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    423
  3. Mirek Endys

    CSSClass in MasterPage at DesignTime

    Mirek Endys, Mar 17, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    477
    Mirek Endys
    Mar 17, 2006
  4. Varangian
    Replies:
    7
    Views:
    584
    Varangian
    Apr 27, 2006
  5. Dst

    Resize usercontrols designtime

    Dst, Jun 22, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    386
Loading...

Share This Page