Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Comments
Herman<T>.Instance 28-Feb-12 10:37am    
what have you tried?
Jephunneh Malazarte 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:
<runtime>
<assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentassembly>
<assemblyidentity name="System.Web.Extensions" publickeytoken="31bf3856ad364e35">
<bindingredirect oldversion="1.0.0.0-1.1.0.0" newversion="3.5.0.0">

<dependentassembly>
<assemblyidentity name="System.Web.Extensions.Design" publickeytoken="31bf3856ad364e35">
<bindingredirect oldversion="1.0.0.0-1.1.0.0" newversion="3.5.0.0">




but after adding that i am getting another exception.. :'(

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.
 
Share this answer
 
Comments
Jephunneh Malazarte 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'
Sergey Alexandrovich Kryukov 28-Feb-12 19:34pm    
This can happen...
--SA
Jephunneh Malazarte 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.
Sergey Alexandrovich Kryukov 28-Feb-12 19:33pm    
Not exactly. I explained it in my comment and the answer.
--SA
Sergey Alexandrovich Kryukov 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
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
 
Share this answer
 
Comments
Jephunneh Malazarte 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900