473,387 Members | 1,650 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,387 software developers and data experts.

Access custom objects from codebehind

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
2 1103
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Oyvind | last post by:
I'm working on a Windows forms/C# database application. My background is 6-7 years of VB 4 - 6, MS Access, VC++, mixed in with a lot of T-SQL and MS SQL Server in general and some OOA/OOD. ...
6
by: mark | last post by:
I have an asp.net ecommerce web application on a remote web server. I'm using an Access database on the back end. I've notice a few strange things. When I mimic an multiple user environment by...
5
by: Karl Hungus | last post by:
Say I have a code behind class, and in that I want to instantiate and call methods on some objects Ive written in other cs files, what do I need to do to make those objects available within the...
29
by: Patrick | last post by:
I have the following code, which regardless which works fine and logs to the EventViewer regardless of whether <processModel/> section of machine.config is set to username="SYSTEM" or "machine" ...
11
by: Josh Flanagan | last post by:
I am trying to write to the event log from ASP.NET, on Windows XP SP1. As soon as I try to write an event (or even query the source with EventLog.SourceExists() or EventLog.LogNameFromSourceName())...
3
by: David Freeman | last post by:
Hi There! I'm having trouble dynamically adding custom controls. My custom controls does not use code-behind but only <script /> block for programming. So as a result, I don't need to compile my...
3
by: Mr Newbie | last post by:
I am messing around with Web User Controls at present and (think) I have discovered the following. 1.) The identifier for the control in the code behind must match the ID for the control on the...
9
by: Jaybuffet | last post by:
my aspx has something like this <asp:Repeater id="Repeater1" runat="server"> <ItemTemplate> <mycontrol:ctl id="ctlId" obj='<%# Container.DataItem %>' showItem="true"/> </ItemTemplate>...
3
by: Mark Leistner | last post by:
I am having problems getting a gridview to bind to custom objects under any non-full trust level. I created a test project to verify what I am seeing isn't a side effect of other code in my...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.