473,406 Members | 2,439 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,406 software developers and data experts.

loading assembly new appdomain

Hi all,

I'm writing some code to automatically update my application when
changes have been made. I had it all working by using the LoadFrom
method of an assembly and checking the version information, etc...
until I realized that was actually locking the files on the common
drive where the updated app is located. I know the solution to this is
to load the assembly into another appdomain, then check and unload it,
but I can't seem to get it loaded into the other domain.

For testing, my version is 1.3 and the shared version is 1.5, so I
should get new components when I start the app. When I changed it to
use the load method from the new domain, it only wanted to load the 1.3
(old) version. So I've been messing with the
CreateInstanceFromAndUnwrap method and not having any luck. It is
throwing exceptions about not being able to load the assembly.

here is the code, hopefully someone can tell me what I'm doing wrong or
even better, the correct way to do it.

'mIBBaseHome is the path where the updated version exists
'mIBEXEName is the name of the application

Dim chkInfo As New AppDomainSetup
Dim adevidence As Evidence = AppDomain.CurrentDomain.Evidence
chkInfo.ApplicationBase = mIBBaseHome
chkInfo.ShadowCopyFiles = True
chkDomain = AppDomain.CreateDomain("CheckNewVersion", adevidence,
chkInfo)
assblyNewExe = chkDomain.CreateInstanceFromAndUnwrap(mIBBaseHome &
mIBEXEName, "MyMod.Main") <-- throws "can't load' exception -->

Since all I need is the version info, i thought for the "Type" I should
just use the Sub Main method, although I'm really not sure what the
type (in the create method call) should be.

Thanks,
Mark

Nov 21 '05 #1
0 951

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

Similar topics

2
by: Foehammer | last post by:
Hello, I'm trying to load an assembly dynamically using an app domain. This is a proof-of-concept for a larger project, so please excuse the lame class names. TestLib is the dll where all the...
3
by: Mike Krueger | last post by:
Hi I'm currently working on a forms designer for a free .NET IDE (SharpDevelop -> www.icsharpcode.net/OpenSource/SD). problem: I try to put 'custom' components (user controls from the current...
4
by: Mark | last post by:
I wan't to be able to deserialize a class from an assembly that is not in the application domain. To do that I must have the Type from the Assembly. How do you get a Type from an assembly that is...
5
by: JonS. | last post by:
Hi, I posted this article ( http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.dotnet.languages.csharp&mid=0ee9781a-78f7-4398-a0ef-eeb195eccaea&sloc=en-us ) last week, and...
6
by: Pete Davis | last post by:
I'm confused about what precisely the limitations are on loading plugins in separate app domains. In all my previous apps that supported plugins, I've loaded them into the same domain as the app,...
1
by: Andrew Ducker | last post by:
I'm trying to load an assembly into a temporary AppDomain rather than my main AppDomain, so that it can be unloaded later on. However, it's also loading into my main AppDomain at the same time. ...
0
by: Ratul | last post by:
Hi all! I'm writing a winforms test harness which lets me specify a subfolder from which to load a particular .net assembly dll. The idea is that there will be multiple subfolders, each having...
5
by: RickN | last post by:
I want to creat a new application domain called 'mydomain' and then load an assembly named 'myassembly.dll' into the domain. The assembly is in the folder "C:\Mydata\assembly", which is not the...
0
by: Michael Kremser | last post by:
Hi NG! I have troubles with loading an application to its own app domain. I have two applications: An caller application named "OfficeTSWCallerDemo" (in a directory like...
1
by: =?Windows-1252?Q?Tor_B=E5dshaug?= | last post by:
BlankHi, I am having trouble loading assemblies from the database in my ASP.NET app. I have a default.aspx in my app that is served from a database via a custom virtual path provider. This works...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...
0
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...

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.