473,386 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to share code between two different sites?

Neo
Hello All,

I found that ASP.net website only accepts code withing site directory.
This creates big hurdle in shairng code. How to share code between two
websites, like the way share between two non-website code?

-Pravin

Jul 14 '06 #1
15 5778
Add a new project of type Class to your web site, place the code in there
that you want to share, and then add this existing class project to the other
web site.
--
Harolds
"Neo" wrote:
Hello All,

I found that ASP.net website only accepts code withing site directory.
This creates big hurdle in shairng code. How to share code between two
websites, like the way share between two non-website code?

-Pravin

Jul 14 '06 #2

Neo wrote:
I found that ASP.net website only accepts code withing site directory.
This creates big hurdle in shairng code. How to share code between two
websites, like the way share between two non-website code?
yes, you need to write your shared code into "class libraries"
projects, which are then compiled into .DLL assemblies. you then
distribute copies of these DLLs to the /bin folders of any other
website that youd like to make use of the shared code.

only caveat is, any time you update the shared-code project(s), you
must re-distribute the new .DLL to all the websites that use it.

another approach, is to write "web services" that perform common tasks,
and your various websites can consume the central webservice.
matt

Jul 14 '06 #3
If you add the "class libraries" project to each web site solution you have
to worry about the redistribution of the dll, and you can add/update the code
in the class libraries from either web site solution.
--
Harolds
"ma**@mailinator.com" wrote:
>
Neo wrote:
I found that ASP.net website only accepts code withing site directory.
This creates big hurdle in shairng code. How to share code between two
websites, like the way share between two non-website code?

yes, you need to write your shared code into "class libraries"
projects, which are then compiled into .DLL assemblies. you then
distribute copies of these DLLs to the /bin folders of any other
website that youd like to make use of the shared code.

only caveat is, any time you update the shared-code project(s), you
must re-distribute the new .DLL to all the websites that use it.

another approach, is to write "web services" that perform common tasks,
and your various websites can consume the central webservice.
matt

Jul 14 '06 #4

Harolds wrote:
If you add the "class libraries" project to each web site solution you ["dont" ? -matt] have
to worry about the redistribution of the dll, and you can add/update the code
in the class libraries from either web site solution.
ah.. so youre saying instead of just coping the black-box .DLL to each
website, have each website's solution include the class library as a
child project.

yes that could be a better way to do it -- since each website points to
the same class project on the file system, it will build & include the
latest into that particular website.
matt

Jul 14 '06 #5
Neo
so what you mean, is child class project can refer to files outsite the
website folder? Isn't this flaw in secuirty? Normal aspx pages must
stay in webfolder where as class files can be outsite? I was under the
imporession all class files must be in app_dir folder.
-neo

ma**@mailinator.com wrote:
Harolds wrote:
If you add the "class libraries" project to each web site solution you ["dont" ? -matt] have
to worry about the redistribution of the dll, and you can add/update the code
in the class libraries from either web site solution.

ah.. so youre saying instead of just coping the black-box .DLL to each
website, have each website's solution include the class library as a
child project.

yes that could be a better way to do it -- since each website points to
the same class project on the file system, it will build & include the
latest into that particular website.
matt
Jul 15 '06 #6
Neo
I just checked and found
1. You can't add child project to website.
2. Whenever you add reference to a dll, it gets copied in /bin folder
so you are always using duplicate not the orignal dll.

So effecitively, when we create update dll we must add it manually to
all websites. That sounds like nightmare. Is there really no solution
from microsoft to update dll automatically???

Web services sounds real cool solution but why won't that be slower if
network between servicing site and using site is slower?

-Neo

Neo wrote:
so what you mean, is child class project can refer to files outsite the
website folder? Isn't this flaw in secuirty? Normal aspx pages must
stay in webfolder where as class files can be outsite? I was under the
imporession all class files must be in app_dir folder.
-neo

ma**@mailinator.com wrote:
Harolds wrote:
If you add the "class libraries" project to each web site solution you ["dont" ? -matt] have
to worry about the redistribution of the dll, and you can add/update the code
in the class libraries from either web site solution.
ah.. so youre saying instead of just coping the black-box .DLL to each
website, have each website's solution include the class library as a
child project.

yes that could be a better way to do it -- since each website points to
the same class project on the file system, it will build & include the
latest into that particular website.
matt
Jul 15 '06 #7
re:
Is there really no solution from microsoft to update dll automatically?
Placing an assembly in the GAC will make the
assembly available to all applications on the server.

One dll...one dll update when needed...all applications are served.

Updating the dll is a bit trickier than usual but if you want one dll,
putting the assembly in the GAC is the only way to do it.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neo" <pr*********@gmail.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
>I just checked and found
1. You can't add child project to website.
2. Whenever you add reference to a dll, it gets copied in /bin folder
so you are always using duplicate not the orignal dll.

So effecitively, when we create update dll we must add it manually to
all websites. That sounds like nightmare. Is there really no solution
from microsoft to update dll automatically???

Web services sounds real cool solution but why won't that be slower if
network between servicing site and using site is slower?

-Neo

Neo wrote:
>so what you mean, is child class project can refer to files outsite the
website folder? Isn't this flaw in secuirty? Normal aspx pages must
stay in webfolder where as class files can be outsite? I was under the
imporession all class files must be in app_dir folder.
-neo

ma**@mailinator.com wrote:
Harolds wrote:
If you add the "class libraries" project to each web site solution you ["dont" ? -matt] have
to worry about the redistribution of the dll, and you can add/update the code
in the class libraries from either web site solution.

ah.. so youre saying instead of just coping the black-box .DLL to each
website, have each website's solution include the class library as a
child project.

yes that could be a better way to do it -- since each website points to
the same class project on the file system, it will build & include the
latest into that particular website.
matt

Jul 15 '06 #8
Neo
That doesn't solve my problem though. I have three websites on three
servers. As the code is growing, I have to find a mechanism of
automatic update of shared code. but looks like there isn't any.

I am thinking of writing customize batch program which not only
compiles the common code but adds it to specified directory. This way I
can automate the compilation process. Does Visual studio has any
facility like that? putting dll in multiple pathes after compilation??
-neo

Juan T. Llibre wrote:
re:
Is there really no solution from microsoft to update dll automatically?

Placing an assembly in the GAC will make the
assembly available to all applications on the server.

One dll...one dll update when needed...all applications are served.

Updating the dll is a bit trickier than usual but if you want one dll,
putting the assembly in the GAC is the only way to do it.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neo" <pr*********@gmail.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
I just checked and found
1. You can't add child project to website.
2. Whenever you add reference to a dll, it gets copied in /bin folder
so you are always using duplicate not the orignal dll.

So effecitively, when we create update dll we must add it manually to
all websites. That sounds like nightmare. Is there really no solution
from microsoft to update dll automatically???

Web services sounds real cool solution but why won't that be slower if
network between servicing site and using site is slower?

-Neo

Neo wrote:
so what you mean, is child class project can refer to files outsite the
website folder? Isn't this flaw in secuirty? Normal aspx pages must
stay in webfolder where as class files can be outsite? I was under the
imporession all class files must be in app_dir folder.
-neo

ma**@mailinator.com wrote:
Harolds wrote:
If you add the "class libraries" project to each web site solutionyou ["dont" ? -matt] have
to worry about the redistribution of the dll, and you can add/update the code
in the class libraries from either web site solution.

ah.. so youre saying instead of just coping the black-box .DLL to each
website, have each website's solution include the class library as a
child project.

yes that could be a better way to do it -- since each website pointsto
the same class project on the file system, it will build & include the
latest into that particular website.
matt
Jul 15 '06 #9
re:
I have three websites on three servers.
You *really* should have mentioned that from the beginning.

That looks like it's an awful waste of resources.

What prevents you from having eveything in one server,
where you *could* share* resources ?

re:
As the code is growing, I have to find a
mechanism of automatic update of shared code
If your code is in 3 disconnected servers, I doubt you'll find one.

I don't think you'll find that feature on *any* server,
but if I'm mistaken, I'd learn something of value.

You might look, if you need 3 servers after all, into creating a cluster or a server farm.
That is not so hard to do, and it will make the multiple updates possible.

re:
Does Visual studio has any facility like that?
putting dll in multiple paths after compilation?
Not that I know of, and especially not to 3 disconnected servers.
Again, I don't think that *any* platform allows that.

re:
I am thinking of writing customize batch program which not only
compiles the common code but adds it to specified directory.
This way I can automate the compilation process.
That's a possibility which might work.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neo" <pr*********@gmail.comwrote in message
news:11*********************@s13g2000cwa.googlegro ups.com...
That doesn't solve my problem though. I have three websites on three
servers. As the code is growing, I have to find a mechanism of
automatic update of shared code. but looks like there isn't any.

I am thinking of writing customize batch program which not only
compiles the common code but adds it to specified directory. This way I
can automate the compilation process. Does Visual studio has any
facility like that? putting dll in multiple pathes after compilation??
-neo

Juan T. Llibre wrote:
re:
Is there really no solution from microsoft to update dll automatically?

Placing an assembly in the GAC will make the
assembly available to all applications on the server.

One dll...one dll update when needed...all applications are served.

Updating the dll is a bit trickier than usual but if you want one dll,
putting the assembly in the GAC is the only way to do it.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neo" <pr*********@gmail.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
I just checked and found
1. You can't add child project to website.
2. Whenever you add reference to a dll, it gets copied in /bin folder
so you are always using duplicate not the orignal dll.

So effecitively, when we create update dll we must add it manually to
all websites. That sounds like nightmare. Is there really no solution
from microsoft to update dll automatically???

Web services sounds real cool solution but why won't that be slower if
network between servicing site and using site is slower?

-Neo

Neo wrote:
so what you mean, is child class project can refer to files outsite the
website folder? Isn't this flaw in secuirty? Normal aspx pages must
stay in webfolder where as class files can be outsite? I was under the
imporession all class files must be in app_dir folder.
-neo

ma**@mailinator.com wrote:
Harolds wrote:
If you add the "class libraries" project to each web site solution you ["dont" ? -matt]
have
to worry about the redistribution of the dll, and you can add/update the code
in the class libraries from either web site solution.

ah.. so youre saying instead of just coping the black-box .DLL to each
website, have each website's solution include the class library as a
child project.

yes that could be a better way to do it -- since each website points to
the same class project on the file system, it will build & include the
latest into that particular website.
matt

Jul 15 '06 #10
Neo
Three servers are given since all they are for different clients. But
common code is just same.

I am not that much worried about update to three servers. I am just
worried about sharing code. Appearantly there doesn't seem to be any
mechanism to share code of different websites. When I say website I
don't mean sharing code on different server, I just mean sharing code
in my development machine. Update can be done later whenever there is
patch to be given. I can update three websites manually, what I am not
comfortable adding dll to each site manually (which I might forget :-))

Juan T. Llibre wrote:
re:
I have three websites on three servers.

You *really* should have mentioned that from the beginning.

That looks like it's an awful waste of resources.

What prevents you from having eveything in one server,
where you *could* share* resources ?

re:
As the code is growing, I have to find a
mechanism of automatic update of shared code

If your code is in 3 disconnected servers, I doubt you'll find one.

I don't think you'll find that feature on *any* server,
but if I'm mistaken, I'd learn something of value.

You might look, if you need 3 servers after all, into creating a cluster or a server farm.
That is not so hard to do, and it will make the multiple updates possible.

re:
Does Visual studio has any facility like that?
putting dll in multiple paths after compilation?

Not that I know of, and especially not to 3 disconnected servers.
Again, I don't think that *any* platform allows that.

re:
I am thinking of writing customize batch program which not only
compiles the common code but adds it to specified directory.
This way I can automate the compilation process.

That's a possibility which might work.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neo" <pr*********@gmail.comwrote in message
news:11*********************@s13g2000cwa.googlegro ups.com...
That doesn't solve my problem though. I have three websites on three
servers. As the code is growing, I have to find a mechanism of
automatic update of shared code. but looks like there isn't any.

I am thinking of writing customize batch program which not only
compiles the common code but adds it to specified directory. This way I
can automate the compilation process. Does Visual studio has any
facility like that? putting dll in multiple pathes after compilation??
-neo

Juan T. Llibre wrote:
re:
Is there really no solution from microsoft to update dll automatically?
Placing an assembly in the GAC will make the
assembly available to all applications on the server.

One dll...one dll update when needed...all applications are served.

Updating the dll is a bit trickier than usual but if you want one dll,
putting the assembly in the GAC is the only way to do it.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neo" <pr*********@gmail.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
>I just checked and found
1. You can't add child project to website.
2. Whenever you add reference to a dll, it gets copied in /bin folder
so you are always using duplicate not the orignal dll.
>
So effecitively, when we create update dll we must add it manually to
all websites. That sounds like nightmare. Is there really no solution
from microsoft to update dll automatically???
>
Web services sounds real cool solution but why won't that be slower if
network between servicing site and using site is slower?
>
-Neo
>
Neo wrote:
>so what you mean, is child class project can refer to files outsite the
>website folder? Isn't this flaw in secuirty? Normal aspx pages must
>stay in webfolder where as class files can be outsite? I was under the
>imporession all class files must be in app_dir folder.
>-neo
>>
>ma**@mailinator.com wrote:
Harolds wrote:
If you add the "class libraries" project to each web site solution you ["dont" ? -matt]
have
to worry about the redistribution of the dll, and you can add/update the code
in the class libraries from either web site solution.
>
ah.. so youre saying instead of just coping the black-box .DLL to each
website, have each website's solution include the class library asa
child project.
>
yes that could be a better way to do it -- since each website points to
the same class project on the file system, it will build & includethe
latest into that particular website.
>
>
matt
>
Jul 16 '06 #11
Neo
One thing I missed, there is parameter called "auto-refresh path" for
added class library dll. Which takes care of auto-update so, adding dll
does solve my problem!
-Thanks
neo.
I guess, this does update if source dll is changed.
Neo wrote:
Three servers are given since all they are for different clients. But
common code is just same.

I am not that much worried about update to three servers. I am just
worried about sharing code. Appearantly there doesn't seem to be any
mechanism to share code of different websites. When I say website I
don't mean sharing code on different server, I just mean sharing code
in my development machine. Update can be done later whenever there is
patch to be given. I can update three websites manually, what I am not
comfortable adding dll to each site manually (which I might forget :-))

Juan T. Llibre wrote:
re:
I have three websites on three servers.
You *really* should have mentioned that from the beginning.

That looks like it's an awful waste of resources.

What prevents you from having eveything in one server,
where you *could* share* resources ?

re:
As the code is growing, I have to find a
mechanism of automatic update of shared code
If your code is in 3 disconnected servers, I doubt you'll find one.

I don't think you'll find that feature on *any* server,
but if I'm mistaken, I'd learn something of value.

You might look, if you need 3 servers after all, into creating a cluster or a server farm.
That is not so hard to do, and it will make the multiple updates possible.

re:
Does Visual studio has any facility like that?
putting dll in multiple paths after compilation?
Not that I know of, and especially not to 3 disconnected servers.
Again, I don't think that *any* platform allows that.

re:
I am thinking of writing customize batch program which not only
compiles the common code but adds it to specified directory.
This way I can automate the compilation process.
That's a possibility which might work.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neo" <pr*********@gmail.comwrote in message
news:11*********************@s13g2000cwa.googlegro ups.com...
That doesn't solve my problem though. I have three websites on three
servers. As the code is growing, I have to find a mechanism of
automatic update of shared code. but looks like there isn't any.

I am thinking of writing customize batch program which not only
compiles the common code but adds it to specified directory. This way I
can automate the compilation process. Does Visual studio has any
facility like that? putting dll in multiple pathes after compilation??
-neo

Juan T. Llibre wrote:
re:
Is there really no solution from microsoft to update dll automatically?
>
Placing an assembly in the GAC will make the
assembly available to all applications on the server.
>
One dll...one dll update when needed...all applications are served.
>
Updating the dll is a bit trickier than usual but if you want one dll,
putting the assembly in the GAC is the only way to do it.
>
>
>
>
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neo" <pr*********@gmail.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
I just checked and found
1. You can't add child project to website.
2. Whenever you add reference to a dll, it gets copied in /bin folder
so you are always using duplicate not the orignal dll.

So effecitively, when we create update dll we must add it manually to
all websites. That sounds like nightmare. Is there really no solution
from microsoft to update dll automatically???

Web services sounds real cool solution but why won't that be slowerif
network between servicing site and using site is slower?

-Neo

Neo wrote:
so what you mean, is child class project can refer to files outsite the
website folder? Isn't this flaw in secuirty? Normal aspx pages must
stay in webfolder where as class files can be outsite? I was underthe
imporession all class files must be in app_dir folder.
-neo
>
ma**@mailinator.com wrote:
Harolds wrote:
If you add the "class libraries" project to each web site solution you ["dont" ? -matt]
have
to worry about the redistribution of the dll, and you can add/update the code
in the class libraries from either web site solution.

ah.. so youre saying instead of just coping the black-box .DLL to each
website, have each website's solution include the class library as a
child project.

yes that could be a better way to do it -- since each website points to
the same class project on the file system, it will build & include the
latest into that particular website.


matt
Jul 16 '06 #12
re:
>I am just worried about sharing code
Tell me, how do you plan on customizing each
application if you have common code for all ?

Are the applications *that* identical that the same code works for all ?

In that case, what's stopping you from having 3 different projects,
and just updating the projects with a batch file copy ?

Then, publishing to the 3 apps is only one click away for each app.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neo" <pr*********@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Three servers are given since all they are for different clients. But
common code is just same.

I am not that much worried about update to three servers. I am just
worried about sharing code. Appearantly there doesn't seem to be any
mechanism to share code of different websites. When I say website I
don't mean sharing code on different server, I just mean sharing code
in my development machine. Update can be done later whenever there is
patch to be given. I can update three websites manually, what I am not
comfortable adding dll to each site manually (which I might forget :-))

Juan T. Llibre wrote:
re:
I have three websites on three servers.

You *really* should have mentioned that from the beginning.

That looks like it's an awful waste of resources.

What prevents you from having eveything in one server,
where you *could* share* resources ?

re:
As the code is growing, I have to find a
mechanism of automatic update of shared code

If your code is in 3 disconnected servers, I doubt you'll find one.

I don't think you'll find that feature on *any* server,
but if I'm mistaken, I'd learn something of value.

You might look, if you need 3 servers after all, into creating a cluster or a server farm.
That is not so hard to do, and it will make the multiple updates possible.

re:
Does Visual studio has any facility like that?
putting dll in multiple paths after compilation?

Not that I know of, and especially not to 3 disconnected servers.
Again, I don't think that *any* platform allows that.

re:
I am thinking of writing customize batch program which not only
compiles the common code but adds it to specified directory.
This way I can automate the compilation process.

That's a possibility which might work.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neo" <pr*********@gmail.comwrote in message
news:11*********************@s13g2000cwa.googlegro ups.com...
That doesn't solve my problem though. I have three websites on three
servers. As the code is growing, I have to find a mechanism of
automatic update of shared code. but looks like there isn't any.

I am thinking of writing customize batch program which not only
compiles the common code but adds it to specified directory. This way I
can automate the compilation process. Does Visual studio has any
facility like that? putting dll in multiple pathes after compilation??
-neo

Juan T. Llibre wrote:
re:
Is there really no solution from microsoft to update dll automatically?
Placing an assembly in the GAC will make the
assembly available to all applications on the server.

One dll...one dll update when needed...all applications are served.

Updating the dll is a bit trickier than usual but if you want one dll,
putting the assembly in the GAC is the only way to do it.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neo" <pr*********@gmail.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
>I just checked and found
1. You can't add child project to website.
2. Whenever you add reference to a dll, it gets copied in /bin folder
so you are always using duplicate not the orignal dll.
>
So effecitively, when we create update dll we must add it manually to
all websites. That sounds like nightmare. Is there really no solution
from microsoft to update dll automatically???
>
Web services sounds real cool solution but why won't that be slower if
network between servicing site and using site is slower?
>
-Neo
>
Neo wrote:
>so what you mean, is child class project can refer to files outsite the
>website folder? Isn't this flaw in secuirty? Normal aspx pages must
>stay in webfolder where as class files can be outsite? I was under the
>imporession all class files must be in app_dir folder.
>-neo
>>
>ma**@mailinator.com wrote:
Harolds wrote:
If you add the "class libraries" project to each web site solution you ["dont" ? -matt]
have
to worry about the redistribution of the dll, and you can add/update the code
in the class libraries from either web site solution.
>
ah.. so youre saying instead of just coping the black-box .DLL to each
website, have each website's solution include the class library as a
child project.
>
yes that could be a better way to do it -- since each website points to
the same class project on the file system, it will build & include the
latest into that particular website.
>
>
matt
>

Jul 16 '06 #13
Neo
Not all files are same. But some functionality like file logging, file
download code etc is common.

Each website has customize code as well as re-used common code. Of
course I can do batch copy but I want to happened automatically.

but this auto-refresh file property does the job. so I am all set.

Juan T. Llibre wrote:
re:
I am just worried about sharing code

Tell me, how do you plan on customizing each
application if you have common code for all ?

Are the applications *that* identical that the same code works for all ?

In that case, what's stopping you from having 3 different projects,
and just updating the projects with a batch file copy ?

Then, publishing to the 3 apps is only one click away for each app.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neo" <pr*********@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Three servers are given since all they are for different clients. But
common code is just same.

I am not that much worried about update to three servers. I am just
worried about sharing code. Appearantly there doesn't seem to be any
mechanism to share code of different websites. When I say website I
don't mean sharing code on different server, I just mean sharing code
in my development machine. Update can be done later whenever there is
patch to be given. I can update three websites manually, what I am not
comfortable adding dll to each site manually (which I might forget :-))

Juan T. Llibre wrote:
re:
I have three websites on three servers.
You *really* should have mentioned that from the beginning.

That looks like it's an awful waste of resources.

What prevents you from having eveything in one server,
where you *could* share* resources ?

re:
As the code is growing, I have to find a
mechanism of automatic update of shared code
If your code is in 3 disconnected servers, I doubt you'll find one.

I don't think you'll find that feature on *any* server,
but if I'm mistaken, I'd learn something of value.

You might look, if you need 3 servers after all, into creating a cluster or a server farm.
That is not so hard to do, and it will make the multiple updates possible.

re:
Does Visual studio has any facility like that?
putting dll in multiple paths after compilation?
Not that I know of, and especially not to 3 disconnected servers.
Again, I don't think that *any* platform allows that.

re:
I am thinking of writing customize batch program which not only
compiles the common code but adds it to specified directory.
This way I can automate the compilation process.
That's a possibility which might work.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neo" <pr*********@gmail.comwrote in message
news:11*********************@s13g2000cwa.googlegro ups.com...
That doesn't solve my problem though. I have three websites on three
servers. As the code is growing, I have to find a mechanism of
automatic update of shared code. but looks like there isn't any.

I am thinking of writing customize batch program which not only
compiles the common code but adds it to specified directory. This way I
can automate the compilation process. Does Visual studio has any
facility like that? putting dll in multiple pathes after compilation??
-neo

Juan T. Llibre wrote:
re:
Is there really no solution from microsoft to update dll automatically?
>
Placing an assembly in the GAC will make the
assembly available to all applications on the server.
>
One dll...one dll update when needed...all applications are served.
>
Updating the dll is a bit trickier than usual but if you want one dll,
putting the assembly in the GAC is the only way to do it.
>
>
>
>
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Neo" <pr*********@gmail.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
I just checked and found
1. You can't add child project to website.
2. Whenever you add reference to a dll, it gets copied in /bin folder
so you are always using duplicate not the orignal dll.

So effecitively, when we create update dll we must add it manually to
all websites. That sounds like nightmare. Is there really no solution
from microsoft to update dll automatically???

Web services sounds real cool solution but why won't that be slowerif
network between servicing site and using site is slower?

-Neo

Neo wrote:
so what you mean, is child class project can refer to files outsite the
website folder? Isn't this flaw in secuirty? Normal aspx pages must
stay in webfolder where as class files can be outsite? I was underthe
imporession all class files must be in app_dir folder.
-neo
>
ma**@mailinator.com wrote:
Harolds wrote:
If you add the "class libraries" project to each web site solution you ["dont" ? -matt]
have
to worry about the redistribution of the dll, and you can add/update the code
in the class libraries from either web site solution.

ah.. so youre saying instead of just coping the black-box .DLL to each
website, have each website's solution include the class library as a
child project.

yes that could be a better way to do it -- since each website points to
the same class project on the file system, it will build & include the
latest into that particular website.


matt
Jul 16 '06 #14

Neo wrote:
Not all files are same. But some functionality like file logging, file
download code etc is common.
i believe this is simple.

if you have 3 websites that live on different servers, but your
development is all on the same machine.. then you just create three
seperate solutions in VS.NET. each solution has two projects:

1) the unique website
2) a "my common code" project, w/ your shared code

....the common-code project lives on the filesystem outside of *any* of
the websites. ala:

c:\projects\MyCommonCode\
c:\projects\Website1
c:\projects\Website2
c:\projects\Website3

as mentioned, in each solution you include a "Project Reference" to the
MyCommonCode project. you can update the code in this project at any
time from any of the 3 solutions. when you re-build any of the 3
solutions, they will build the latest version of the MyCommonCode
project and automatically copy it to your current solutions' /bin.

that works.

now, if you want it to *automatically* update *all* 3 solutions (w/o
manually re-building each), then you must use the GAC idea as described
by another.

or, you could write some code that monitors the /bin/release folder of
the MyCommonCode project, and when its updated FTP copy it to your
other solutions.
matt

Jul 17 '06 #15
You add a child project to your website, by selecting Add/'(New/Existing)
Project...' under the File menu in VS 2005.
--
Harolds
"Neo" wrote:
I just checked and found
1. You can't add child project to website.
2. Whenever you add reference to a dll, it gets copied in /bin folder
so you are always using duplicate not the orignal dll.

So effecitively, when we create update dll we must add it manually to
all websites. That sounds like nightmare. Is there really no solution
from microsoft to update dll automatically???

Web services sounds real cool solution but why won't that be slower if
network between servicing site and using site is slower?

-Neo

Neo wrote:
so what you mean, is child class project can refer to files outsite the
website folder? Isn't this flaw in secuirty? Normal aspx pages must
stay in webfolder where as class files can be outsite? I was under the
imporession all class files must be in app_dir folder.
-neo

ma**@mailinator.com wrote:
Harolds wrote:
If you add the "class libraries" project to each web site solution you ["dont" ? -matt] have
to worry about the redistribution of the dll, and you can add/update the code
in the class libraries from either web site solution.
>
ah.. so youre saying instead of just coping the black-box .DLL to each
website, have each website's solution include the class library as a
child project.
>
yes that could be a better way to do it -- since each website points to
the same class project on the file system, it will build & include the
latest into that particular website.
>
>
matt

Oct 13 '06 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: John Bailo | last post by:
I build an NT service using the FileSystemWatcher() class to detect when new files arrive at our ftp server. Now I want to configure it to watch for files on someone else's remote server. ...
346
by: rkusenet | last post by:
http://biz.yahoo.com/rc/040526/tech_database_marketshare_1.html Interesting to see that database sales for windows is more than Unix.
0
by: Tom | last post by:
Hello friends I have 2 webs sites on same domain say http://app1.mydomain.com http://app2.mydomain.com App1 use custom validation, via a custom login page user can enter their WinNT...
2
by: Sam-I-Am | last post by:
Hi There I have multiple asp.net web apps that all make use of a common set of sql data. I currently have each application cache this data using the cache api. As the data is same for all...
4
by: Quentin Huo | last post by:
Hi: I have two web sites in my IIS. I want them to share or use one set of classes that I created, because they have same functions that the classses provide. And maybe in the future I will...
0
by: Eric | last post by:
I have this same problem, and I've *half-way* resolved it. It turns out that this is not exactly an IO problem; it's actually a security issue and maybe even an ASP.NET bug. Here is what I've...
3
by: Bob Peek | last post by:
I would like to share code between several web sites that exist as virtual directories under a single site. It appears that I have to create an app_code directory under each virtual root in order...
0
by: =?Utf-8?B?SGFucw==?= | last post by:
Hi! When I start my app from a specific local directory, it works fine. When, however, I share that directory and start from the share, it throws a security exception. I have added the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.