473,807 Members | 2,884 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1126
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*****@hotmai l.com> wrote in message
news:39******** *************** ***@posting.goo gle.com...
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
2093
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. Previously, I haven't been overly impressed with the capabilities of the various "graphical" data access tools that have been provided with VB etc. Though deceptively simple to get started with, IMHO they haven't provided the necessary flexibility...
6
539
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 surfin it in multiple browsers simultaneously the site generates a generic runtime error after awhile. I'm thinking this has something to do with my access database and multiple connections. I'm using forms authentication with a login page. Is...
5
1046
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 codebehind? thanks in advance
29
15555
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" ---Start of test.aspx---- <%@ Page language="C#" AutoEventWireup="false" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <HEAD>
11
3609
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()) I get a SecurityException "Requested registry access is not allowed.". I have read the KB article associated with this error message, which indicates the source needs to be created outside of ASP.NET. I created an Installer class, and ran...
3
6295
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 custom controls to dll for them to work. But I wonder, if I don't compile to dll, can I still dynamically add that custom control? If so how? Below is how I've tried (and failed). At top of the page...
3
1937
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 page. 2.) The identifier must be delcared with a minimum access of 'Protected' in order to work. If the above is indeed correct, then I have made the following assumptions
9
4696
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> /asp:Repeater> The DataSource for this Repeater is a CollectionBase of objects and is
3
2035
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 project and I get the same errors there: Exception Details: System.Security.SecurityException: That assembly does not allow partially trusted callers.
0
10626
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3854
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.