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

Type Reflection and Code Directory

Is someone from MS listening? Every thread I've seen on this topic
goes dead. Even the MVP's don't seem to have an answer.

My problem:
I'm working with ASP.NET 2.0 Beta 1. I have all web application
instance-specific code factored into the /code directory of my web
project. I have custom EventArgs/Handler's for my current web app
instance that I would like to create and use dynamically via
reflection, from a web control in the same web project. The statement
Type.GetType("myCustomEventArgsType") returns null. I've seen some
posts online about specifying the assembly qualified name as in
"myCustomEventArgsType,Code", but this appears to be an out of date
piece of advice as the dynamically generated assembly has an
autogenerated name. The funny thing is that intellisense picks up this
type at design time, it is just unavailable, or unreachable, at
runtime.

This "feature" severely limits the dynamic capabilities of web
applications built in Whidbey. As we all know this was all possible in
1.1 as the web project was compiled into a well known DLL. I know big
changes are coming in Beta 2, but I would like to know for sure whether
these changes will alleviate this problem, and if there is any possible
work around in current Beta 1 bits. Thank you.

Nov 19 '05 #1
2 974
Hello Andrew,

Are you calling GetType from code that is inside that dynamic assembly? With
specifying
an assembly name I believe get type only looks in the current assembly and
mscorlib.

--
Scott
http://www.OdeToCode.com/blogs/scott/

Is someone from MS listening? Every thread I've seen on this topic
goes dead. Even the MVP's don't seem to have an answer.

My problem:
I'm working with ASP.NET 2.0 Beta 1. I have all web application
instance-specific code factored into the /code directory of my web
project. I have custom EventArgs/Handler's for my current web app
instance that I would like to create and use dynamically via
reflection, from a web control in the same web project. The statement
Type.GetType("myCustomEventArgsType") returns null. I've seen some
posts online about specifying the assembly qualified name as in
"myCustomEventArgsType,Code", but this appears to be an out of date
piece of advice as the dynamically generated assembly has an
autogenerated name. The funny thing is that intellisense picks up
this
type at design time, it is just unavailable, or unreachable, at
runtime.
This "feature" severely limits the dynamic capabilities of web
applications built in Whidbey. As we all know this was all possible
in 1.1 as the web project was compiled into a well known DLL. I know
big changes are coming in Beta 2, but I would like to know for sure
whether these changes will alleviate this problem, and if there is any
possible work around in current Beta 1 bits. Thank you.



Nov 19 '05 #2
I assume you mean "WithOUT specifying an assembly name..."

The problem is that in ASP.NET 1.1 the entire web project was compiled
into a single dll with a well known name, and all types in it were
visible to each other. With the /code directory being compiled into
its own dll, with a randomly generated name, how am I supposed to
utilize any of these types at runtime? Sure the /code directory is
neat, and useful at design time, but without the ability to utilize it
at runtime severely reduces its utility. Again I realize that this is
a premature product, and that changes are coming, but certainly I am
not the first one to encounter this problem and so (hopefully) someone
has found a workaround.

Nov 19 '05 #3

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

Similar topics

1
by: Dominique Vandensteen | last post by:
I want to dynamicly load a type (typename is defined in the database). This type is located in the exe itself or one of the dll's in the directory with the exe file. When creating an instance...
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}"...
7
by: Paul Hadfield | last post by:
Hi, I'm running into one problem with trying to call "Type.GetCustomAttributes(...)" on my reflected code. Basically - I can't trap my own custom attribute - I can only catch / identify system...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...

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.