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

Searching for types

Hi there,

If I call "System.Type.GetType()", passing in the assembly-qualified name of
the type to search for, how can I go about controlling where .NET will look
for the assembly containing the type. Assuming I'm not using strong names
for instance (no GAC involved), and I pass the following string for example:

"SomeNamespacee.SomeDialog, SomeApp, Version=1.0.2896.22054,
Culture=neutral, PublicKeyToken=null"

I now want "System.Type.GetType()" to look for the "SomeApp" assembly in a
given folder that I can control at runtime (instead of or in addition to my
app's start-up folder). Thanks in advance.
Dec 7 '07 #1
3 1055
>I now want "System.Type.GetType()" to look for the "SomeApp" assembly in a
given folder that I can control at runtime (instead of or in addition to my
app's start-up folder). Thanks in advance.
You can also first load the assembly from the location you want (using
Assembly.LoadFrom) and then call Assembly.GetType on that instance.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Dec 7 '07 #2
You can also first load the assembly from the location you want (using
Assembly.LoadFrom) and then call Assembly.GetType on that instance.
Thanks. Unfortunately, the assembly-qualified strings I need to call
"GetType()" on are arbitary strings I don't know about ahead of time. I want
my users to be able to set a search folder in my app (via "Tools ->
Options") and calls to "GetType()" will then look in that folder
automatically. I just need to instruct the system to look there accordingly.
Dec 7 '07 #3
I think that in this case, you will have to manually load the assembly
into your app domain (the one you are running in, or another one,
depending on your program) and call the static LoadFile method on the
Assembly to get the CLR to load your assembly, then call GetType, passing
the assembly qualified name.
Yeah, it's looking that way. I'm digging into the docs now but may provide a
follow-up later if I can't unravel this myself. Thanks again for your help.
Dec 7 '07 #4

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

Similar topics

0
by: Mike | last post by:
Sites using thumbnail preview for world wide web file navigation and searching. Below are list of sites that are either researching or providing thumbnail preview images for online web...
6
by: Jonathan | last post by:
I am hoping that someone more experienced than myself can point me towards what might be the fastest data lookup method to use for storing ip addresses. My situation is that I will need to maintain...
3
by: Julia | last post by:
Hi, We have an ASP.NET site,and a data base which contains different types of XML documents I would like to ask which technology is best to use for searching XML documents. My concern is that a...
2
by: =?Utf-8?B?VGVycnk=?= | last post by:
I am implementing an 'incremental search', where as the user types into a textbox, a datagridview's current position is updated to match the first record that contains what the user has typed so...
5
by: praveenhathwar | last post by:
Hi, Im new to this Forum. Im facing a problem from long time. I have a text box. If user types a character, I should display the itemname (records/data) into Flexgrid starting from those characters....
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
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
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
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...
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
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...
0
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...

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.