c# - Can application built with .NET 4.5 run on .NET 4.0? -
my project targeting .net 4.5. doesn't use new 4.5 methods, works fine on machine .net 4.0 installed.
this until added extension methods , reflection. when ran .net 4.5 program on 4.0 machine, failed "system.typeloadexception: not load type 'system.runtime.compilerservices.extensionattribute' assembly mscorlib". famous extensionattribute program has been documented here.
another quick way test add following line. program throw exception when running on .net 4.0 only.
console.writeline(typeof(system.runtime.compilerservices.extensionattribute).assembly.fullname);
i'm wondering if there way work around it. example, ilmerge (when using correct /targetplatform option documented in link) changes extensionattribute mscorlib system.core if project target .net 4.0 (with 4.5 installed). doesn't seem work on project targeted .net 4.5.
i know long shot. want see if has other ideas since close.
thanks.
in general, not work. work in cases since 4.5 in place replacement 4.0, it's not going work in general. i've, personally, seen problems types have moved different assemblies, , bindings aren't setup correctly, you're seeing. reflection types aren't types moved in 4.5.
my project targeting .net 4.5. doesn't use new 4.5 methods, works fine on machine .net 4.0 installed.
if case, change application target .net 4.0. should allow run safely on machine .net 4 installed.
Comments
Post a Comment