c# - Why do I get different results in .NET4 compared to .NET 3.5 -


when have project's target framework set framework 4.0 , run following code:

 assembly pasm = assembly.loadfrom(amagpath);  foreach (module m in pasm.getmodules())  {     type t = m.gettype("typename"));  } 

typename user defined type 3rd party dll.

t null.

if change target type framework 3.5 t not null.

i don't change else. change target framework , rerun application.

can explain why happening? there tool let me more?

update: changed code following.

assembly pasm = assembly.loadfrom(amagpath); type t = pasm.gettype(string.format("gm.fcat.{0}.{0}+fblock+{1}function+{2}casestream+{2}repeatableparameterstream", fblockname, pname, aparam.name), false); 

i still have same problem. t = null in version 4.0 , doesn't in version 3.5

i can't find type when load .net reflector. guess not there.

some framework types have moved across assemblies between versions, assembly binding redirection make usually invisible clients. may explain what's going on, it's hard without knowing assembly , type you're trying find.

edit: okay, we've got bit more context...

that suggests type isn't in module... it's possible there bug in .net 3.5 looked in parent assembly type name instead of within module.

is there reason why have on module-by-module basis, instead of asking assembly type?


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -