473,796 Members | 2,903 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically load assembly

Dear Sirs,
If I dynamically load assembly into the memory by Load(byte[]) how long do I
have to preserve the array valid? Can it be destructed just after the load
call?
Thanks in advance,
Boni
Nov 17 '05 #1
3 1678
Boni,
If I dynamically load assembly into the memory by Load(byte[]) how long do
I have to preserve the array valid? Can it be destructed just after the
load call?


You're in a GC world, meaning it's not your problem anymore :)

That said, I'd probably just leave it alone :)
--
Tomas Restrepo
to****@mvps.org
Nov 17 '05 #2
Hi,
thanks you Tomas.
But I meant with this question, what will be if the variable will go out of
scope?
I have a error, that if I load regestered assembly dynamically from an array
and then use XML Serilaization it throws the exception, where if I use
LoadFrom it is not. So my thougth is, that it need assembly, where the
buffer is allready destructed.

"Tomas Restrepo (MVP)" <to****@mvps.or g> schrieb im Newsbeitrag
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
Boni,
If I dynamically load assembly into the memory by Load(byte[]) how long
do I have to preserve the array valid? Can it be destructed just after
the load call?


You're in a GC world, meaning it's not your problem anymore :)

That said, I'd probably just leave it alone :)
--
Tomas Restrepo
to****@mvps.org

Nov 17 '05 #3
Hi Boni,
Hi,
thanks you Tomas.
But I meant with this question, what will be if the variable will go out
of scope?
Again, not your problem. As long as there's a reference out there pointing
to the memory, it won't be GCd. I doubt this is your problem.
I have a error, that if I load regestered assembly dynamically from an
array and then use XML Serilaization it throws the exception, where if I
use LoadFrom it is not.


What exception are you getting? The problem might very well have to do with
the fact that Load and LoadFrom use different load contexts, for example, or
due to the fact you're not passing any explicit evidence, or a whole other
set of things...
--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/
Nov 17 '05 #4

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

Similar topics

1
1276
by: M. Fitzgerald | last post by:
Our migration from ASP to ASP.NET will be a slow one. In themeantime, I have constructed a .NET assembly and registered itas a COM object for use in out classic ASP pages. One of thethings this particular assembly does is use Reflection todynamically load another assembly (based of course onuser-provided parameters). The original error is in that it could not locate the assembly tobe loaded. I've tried placing the dynamically loaded...
3
4178
by: Tim Mavers | last post by:
I have created a DLL (class library) in .NET that I need to dynamically load from my ASP.NET application. I am trying to use Assembly.Load(...) to load the file, which is in the /bin directory of the web app but I am getting a failure. The class library is just a simple DLL with just one method. It's not strong name, versioned or installed in the GAC. I just want to load it in (without using LoadFrom() and explictly passing...
0
310
by: Tom | last post by:
Thanks Chris : However, during run time, it show error message "File / component cannot find " during run in Dim asm As = AppDomain.CurrentDomain.Load("D:\vb7Project\dynamicCall\prj01\prj01\bin\prj0 1.dll")
2
1227
by: Tom | last post by:
Thanks Chris : However, during run time, it show error message "File / component cannot find " during run in Dim asm As = AppDomain.CurrentDomain.Load("D:\vb7Project\dynamicCall\prj01\prj01\bin\prj0 1.dll")
6
6879
by: Dan Dorey | last post by:
I actually have two questions here, but I'll start by giving an outline of what I'm trying to do. I'm building an app with a simple plugin architecture (all in the same app domain). I have each plugin in a separate sub-dir inside a "Plugins" directory. Each plugin consists of at least two DLLs (a controller and a driver). However, most drivers also rely on other external DLLs. In one particular case this dependency is to a C++ DLL...
1
1968
by: chandu | last post by:
hello , i want to load and execute an existing dll in a applicaiton dynamically with out giving references etc... need to create separate appdomain or in same appdomain can i load and execute the assembly dynamically.......... please give me some idea..
2
3120
by: Smithers | last post by:
Using 3.5, I am stuck in attempting to: 1. Dynamically load an assembly 2. Instantiate a class from that assembly (the client code is in a different namespace than the namespace of the dynamically loaded assembly) so far so good (per my code below)... but here is where I'm getting hung up: 3. Call methods of that type (see comments in my code) If the types in the dynamically loaded assembly were in the same namespace
2
5116
by: Smithers | last post by:
I have a Windows Forms application that implements a plug-in architecture whereby required assemblies are identified and loaded dynamically. Here are the relevant classes: A = application = Windows Forms class B = a singleton hosted within A. B is responsible for dynamically loading classes X, Y, and Z.
1
1381
by: Jordan S. | last post by:
I plan to load an assembly during application startup, and load that assembly via reflection (i.e., it isn't referenced in the application's assembly manifest). The assembly will be loaded into the application's default app domain, with code like this: using System.Reflection; Assembly loadedAssembly = Assembly.LoadFile(pathToMyAssembly); My question: When I need to access members of the assembly , how does the application know to get...
7
10086
by: chage | last post by:
Hi, I have been searching around to try adding reference assembly to another assembly during runtime, programatically. Is this possible in .Net? The reason for this is because i am having trouble using a library that creates an instance of a Type that i specified, and it failed the locate the Type during runtime, if i do not reference it during compile time.
0
9679
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9527
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10453
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
10172
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
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9050
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...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
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...
1
4115
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

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.