c# - Is it possible to pretend to be lower .NET version than it actually is? -


sharepoint 2010 has version check in single place (also starting update wss 3.0 has such check also):

... version version = environment.version; if (version.major > 2) {     ...     throw new platformnotsupportedexception(@string); 

i know, should not this, out of curiosity - possible overcome without writing huge proxy?

just out of curiosity, wondering if possible of these:

  1. adjust check in sharepoint's dll @ runtime pass (class, using sealed , internal, if you're curious, microsoft.sharepoint.administration.spconfigurationdatabase class in microsoft.sharepoint.dll)
  2. temporary override environment.version return value, like:

    using (new environmentversionoverride("2.0")) { ... }

  3. some other way?

update: environment.version decompiled source:

public static version version {     {     return new version("4.0.30319.18444");   } } 

first , foremost, wss 3.0/share point 2010 created such engineers @ microsoft knew version of common language runtime (clr) wss 3.0/share point 2010 run against without errors.

as alluded above, environment.version returns clr version (not .net framework version) loaded in process. there no way "fake" or "proxy" value. if running sharepoint on windows 7, windows server 2008, or windows server 2008 r2 machine, clr 2.0 automatically installed (i'm not sure windows 8 or windows server 2012, though).

it sounds me need make sure application pool in iis under share point 2010 (or wss 3.0) website running using .net framework version 2.0.50727 (which implies use of clr 2.0). stated here, share point 2010 refuse run when website using application pool targeting .net framework 4.0.

if machine running share point 2010 / wss 3.0 not have .net framework 3.5 sp1 installed (which includes clr 2.0), installing , ensuring application pool settings correct should resolve issue , won't need "proxy" value of environment.version.

if you're trying create library use share point 2010, ensure library targeting .net framework 3.5.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -