Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET2.0 .NET3.0 .NET3.5
Is it ok to use the dll created from .net 3.5 framework and utilize in web application running under .net 2.0 framework?
 
The DLL contains ajaxtoolkit for 3.5(scriptmanager, modal popup, and calendar)
Posted 28-Feb-12 5:30am
Comments
digimanus at 28-Feb-12 10:37am
   
what have you tried?
Jephunneh Malazarte at 28-Feb-12 10:54am
   
ya i tried it but i am getting error.
 
System.Web.Extensions
Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'
 
so the fix here to to add certain configuration in web.config as follow:












 
but after adding that i am getting another exception.. :'(
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Yee...esss. You can. But I really wouldn't recommend it.
 
It should complain that it doesn't understand the DLL as it is built with a later version, but it won't stop you working unless you actually use V3.5 features in the DLL.
  Permalink  
Comments
Jephunneh Malazarte at 28-Feb-12 10:56am
   
ya i tried it but i keep getting exception one after another :(
the current exception that i am getting now is the:
 
System.Web.Extensions
Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'
SAKryukov at 28-Feb-12 19:34pm
   
This can happen...
--SA
Jephunneh Malazarte at 28-Feb-12 11:30am
   
OriginalGriff you are right, it is possible and it worked finally i can sleep peacefully... only if we have so much time to modify the old application... but thanks to your answer it gives me hope that it's possible. i'll mark your answer and thanks a lot.
SAKryukov at 28-Feb-12 19:33pm
   
Not exactly. I explained it in my comment and the answer.
--SA
SAKryukov at 28-Feb-12 19:33pm
   
Griff, perhaps you did not understand the question or made another random mistake. Not compiled code targeted to v.3.5 may or may not work with v.2.0, but not a compiled DLL. (I did not vote.) Please see my answer.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

No, you cannot. There is not "created from" this is "targeted to". You should build the DLL with the target 2.0. It may or not compile, because you might use some new .NET features introduced after v.2.0 (new language features do not matter, you can use them).
 
—SA
  Permalink  
Comments
Jephunneh Malazarte at 28-Feb-12 20:18pm
   
If that's the case i wonder why it worked.
i was thinking that maybe (i recently noticed), though it was configured to run under 2.0 framework however the latest framework installed in the server is 3.5.
 
because even using 2008 you still have option to code it in 2.0 right? by changing its configuration in the build properties. anywayz, this setup is very weird and the project is very big and very old. this is only a work around until revised of the entire project.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 555
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,466
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,897


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 28 Feb 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100