473,406 Members | 2,769 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.

Type.GetType(), GAC, strong names

lit
I want to use Type.GetType(typeName) for a class defined in an assembly
that will be in the GAC. I understand that I must provide strong name
information such as the KeyPair or versioninfo in the typeName string.

The Type that I am getting is statically referenced by other classes of
other assemblies that will be loaded into the appdomain. Therefore,
the strong name info should be dynamically available to me.

I want to be able to resolve that typeName without having to hard-code
the strong name info, or provide it via application configuration. Is
this possible?

I could also phrase the question this way: How can I determine the
strong name of an assembly that has been or will be loaded into the
Appdomain?

TIA,

Leo

Feb 9 '06 #1
1 2756
>I could also phrase the question this way: How can I determine the
strong name of an assembly that has been or will be loaded into the
Appdomain?


Well if the assembly is already loaded you can find it with it will be
in the AppDomain.GetAssemblies(). Once you found the Assembly instance
you're looking for you can simply call Assembly.GetType() and just
pass in the type name.

I don't see how you could reliably know which assemblies will be
loaded in the future.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Feb 9 '06 #2

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

Similar topics

11
by: Neo | last post by:
Does anyone know how to get a list of the types in an Assembly without actually loading the Assembly into your app domain?
4
by: Tamir Khason | last post by:
How can I set the type of the object added to ArrayList (type of Array List Members) Here is the code: protected ArrayList tabs = new ArrayList(); public ArrayList Tabs {
7
by: Gary | last post by:
I would like to make a strongly typed, sortable collection by leveraging a Framework class. I began by looking at CollectionBase but it doesn't have built-int sorting. I would prefer to derive...
7
by: | last post by:
Source Error: Line 173: sData(rownumber - 1, lcnt) = WhatCol.Value Line 174: End IF Line 175: If (sData(rownumber, lcnt) = sData(rownumber - 1, lcnt)) AND...
16
by: Dennis | last post by:
I have a class named "myclass" and an arraylist containing elements of type "MyClass". I want to get the value of a property of "MyClass" (a string type) for one of the arraylist elements. I...
7
by: Sky | last post by:
I have been looking for a more powerful version of GetType(string) that will find the Type no matter what, and will work even if only supplied "{TypeName}", not the full "{TypeName},{AssemblyName}"...
1
by: Sky | last post by:
Yesterday I was told that GetType(string) should not just be with a Type, but be Type, AssemblyName. Fair enough, get the reason. (Finally!). As long as it doesn't cause tech support problems...
1
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post by:
I get the above error in some of the ASP.NET web applications on a server, and I need some help figuring out how to deal with it. This is a rather long post, and I hope I have enough details that...
4
by: =?Utf-8?B?QXhlbCBEYWhtZW4=?= | last post by:
Hi, I'd like to create a generic algorithm to analyse an enum's elements for custom attributes. All I have at hand is is a type name to create an enum type info from. But if I call...
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
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
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...
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
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
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.