By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,230 Members | 2,436 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,230 IT Pros & Developers. It's quick & easy.

Access custom objects from codebehind

P: n/a
MAG
Hi,

After using an assembly compiled into a DLL and added to the assembly
cache for several months, we decided that it was too much trouble to
maintain because of all the steps involved with every minor change
(e.g. making the change, compiling, uploading the dll to the
production server, opening vnc and running gacutil, etc...). I have 2
questions associated with the problem, and depending on the answers,
we'll decide what's best:

1- Is there a way to unload the assembly from memory without
restarting the server? From our experience, the only way we found for
updating an assembly in the assembly cache is to restart the machine,
otherwise, the assembly seems to stay in memory and the new dll file
with the modifications is not taken into account.

2- If we move all the dll source code into a single .vb file, is there
a way to access the classes from codebehind? <% Assembly src... %>
does not seem to work for that, the classes being accessible only in
the aspx page and not in the aspx.vb code... With the dll in the
assembly cache, we only had to use Import statement. How do you do
"Import" classes from a .vb file?

Thanx for any useful infos!

MAG
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
depends on the OS of the server.
With 2003 you can flush the app pool or restart the SITE as well.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"MAG" <gi*****@hotmail.com> wrote in message
news:39**************************@posting.google.c om...
Hi,

After using an assembly compiled into a DLL and added to the assembly
cache for several months, we decided that it was too much trouble to
maintain because of all the steps involved with every minor change
(e.g. making the change, compiling, uploading the dll to the
production server, opening vnc and running gacutil, etc...). I have 2
questions associated with the problem, and depending on the answers,
we'll decide what's best:

1- Is there a way to unload the assembly from memory without
restarting the server? From our experience, the only way we found for
updating an assembly in the assembly cache is to restart the machine,
otherwise, the assembly seems to stay in memory and the new dll file
with the modifications is not taken into account.

2- If we move all the dll source code into a single .vb file, is there
a way to access the classes from codebehind? <% Assembly src... %>
does not seem to work for that, the classes being accessible only in
the aspx page and not in the aspx.vb code... With the dll in the
assembly cache, we only had to use Import statement. How do you do
"Import" classes from a .vb file?

Thanx for any useful infos!

MAG

Nov 18 '05 #2

P: n/a
Some thoughts:

You can unload an AppDomain, but you cannot unload an Assembly within an AppDomain. This means that
all of the objects you get out of your Assembly will need to be Serializable since they cross domain
boundaries.

Here's an idea I had a while back, but haven't had the chance to think about further: You could put
that .dll in some folder on the server. Then you could have a Windows Service app that monitors the
file for changes; when there's a change, have it load the file into the GAC for you.

Windows Explorer supports "drag-n-drop" install into the GAC; go do c:\<windows dir>\Assembly\ and
drop the file in. This *does* work over NetBios too, so you can install on a remote box if you don't
mind using that.

I'm unsure about what you mean in #2. You have to add that dll to the "References" section of your
project anyhow or it won't compile. If you just move all the code to the same project, you're done.
If you're going to do that, why not just remove the thing from the GAC entirely and just drop it in
the same directory as the app? (Less things to change/break)

Granger
MAG wrote:
Hi,

After using an assembly compiled into a DLL and added to the assembly
cache for several months, we decided that it was too much trouble to
maintain because of all the steps involved with every minor change
(e.g. making the change, compiling, uploading the dll to the
production server, opening vnc and running gacutil, etc...). I have 2
questions associated with the problem, and depending on the answers,
we'll decide what's best:

1- Is there a way to unload the assembly from memory without
restarting the server? From our experience, the only way we found for
updating an assembly in the assembly cache is to restart the machine,
otherwise, the assembly seems to stay in memory and the new dll file
with the modifications is not taken into account.

2- If we move all the dll source code into a single .vb file, is there
a way to access the classes from codebehind? <% Assembly src... %>
does not seem to work for that, the classes being accessible only in
the aspx page and not in the aspx.vb code... With the dll in the
assembly cache, we only had to use Import statement. How do you do
"Import" classes from a .vb file?

Thanx for any useful infos!

MAG


Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.