ASP.NET Class files served via web?

  • Thread starter Thread starter martin.fowler
  • Start date Start date
M

martin.fowler

Hi everyone, I dont know if this is the correct place for this
question or not, but here it goes. I have multiple projects that I use
the same code for. I wanted to know if it was possible to load a class
file that is served over the web? i.e. in each project I can just load
from one source instead of copy and pasting the cs files all over the
place. There has got to be a way to do this, but I can not find a
resource on the web for information. Any help you can give me would be
appreciated, or if there is no way to do this and I am just barking up
the wrong tree, please let me know.


Thanks.

Martin Fowler
 
Sure, just compile your code and business logic into a class library project,
and you can set a reference to the assembly from any web app and re-use it.
Peter
 
Hi everyone, I dont know if this is the correct place for this
question or not, but here it goes. I have multiple projects that I use
the same code for. I wanted to know if it was possible to load a class
file that is served over the web? i.e. in each project I can just load
from one source instead of copy and pasting the cs files all over the
place. There has got to be a way to do this, but I can not find a
resource on the web for information. Any help you can give me would be
appreciated, or if there is no way to do this and I am just barking up
the wrong tree, please let me know.

Instead of "serving class files" over the web, what most people do is create
a class library project, containing the classes you want to share. This can
the be referenced in several web sites.

Serving your code over the web would allow hackers to intercept the response
and return you whatever code they wanted you to run. Besides, it doesn't
work that way.
 
Back
Top