Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Segregating designtime from runtime

Reply
Thread Tools

Segregating designtime from runtime

 
 
General Chaud Caliente
Guest
Posts: n/a
 
      10-17-2003
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 @.

 
Reply With Quote
 
 
 
 
Jim Cheshire [MSFT]
Guest
Posts: n/a
 
      10-18-2003
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
http://www.velocityreviews.com/forums/(E-Mail Removed)

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: <(E-Mail Removed)>
>Newsgroups: microsoft.public.dotnet.framework.aspnet.buildingc ontrols
>NNTP-Posting-Host: co-ratlsnk-u2-c6c-116.clspco.adelphia.net 68.71.60.116
>Lines: 1
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
>Xref: cpmsftngxa06.phx.gbl

microsoft.public.dotnet.framework.aspnet.buildingc ontrols:7812
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.buildingc ontrols
>
>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 @.
>
>


 
Reply With Quote
 
 
 
 
Victor Garcia Aprea [MVP]
Guest
Posts: n/a
 
      10-19-2003
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]" <(E-Mail Removed)> wrote in message
news:bns$(E-Mail Removed)...
> 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
> (E-Mail Removed)
>
> 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: <(E-Mail Removed)>
> >Newsgroups: microsoft.public.dotnet.framework.aspnet.buildingc ontrols
> >NNTP-Posting-Host: co-ratlsnk-u2-c6c-116.clspco.adelphia.net 68.71.60.116
> >Lines: 1
> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
> >Xref: cpmsftngxa06.phx.gbl

> microsoft.public.dotnet.framework.aspnet.buildingc ontrols:7812
> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.buildingc ontrols
> >
> >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 @.
> >
> >

>



 
Reply With Quote
 
General Chaud Caliente
Guest
Posts: n/a
 
      10-22-2003
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


 
Reply With Quote
 
Victor Garcia Aprea [MVP]
Guest
Posts: n/a
 
      10-23-2003
>>>> 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:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Jim Cheshire [MSFT]
Guest
Posts: n/a
 
      10-23-2003
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/de...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
(E-Mail Removed)

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: <(E-Mail Removed)>

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

microsoft.public.dotnet.framework.aspnet.buildingc ontrols:7853
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.buildingc ontrols
>
>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
>
>
>


 
Reply With Quote
 
General Chaud Caliente
Guest
Posts: n/a
 
      10-24-2003
> 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

 
Reply With Quote
 
General Chaud Caliente
Guest
Posts: n/a
 
      10-24-2003
Thanks Jim. I'll have a look.

--
GCC

 
Reply With Quote
 
Victor Garcia Aprea [MVP]
Guest
Posts: n/a
 
      10-24-2003
>>>> 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:(E-Mail Removed)...
> > 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
>




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Segregating Traffic Bob Simon Cisco 6 02-15-2007 12:43 PM
Discussion about segregating bandwidth with Cisco 7513, Cisco 3750 and Cisco 3640 iskandar@measat.com Cisco 1 06-18-2006 06:30 PM
Creating controls at runtime or designtime Varangian ASP .Net 7 04-27-2006 07:33 AM
VPN: segregating users to different interfaces Bert Roos Cisco 1 02-27-2004 12:11 PM
Adding runtime columns to designtime datagrid Chip ASP .Net 1 11-10-2003 09:14 PM



Advertisments