visual studio 2015 - .NET 4.6 required for .NET 4.5.2 compiled application -


after upgrading building our product in visual studio 2010 , .net 4.0 visual studio 2015 , .net 4.5.2 have seen issues running product on customers machine.

the error see system.missingmethodexception being thrown when starting application, looking @ posts on here point incorrect version of .net being installed on machine. customers machine have .net 4.5.2 installed installed during installation of our product.

the way have fixed issue install .net 4.6 on customers machine.

i have theory ideally want confirm (well preferably rubbish , replace more viable):

  • all of our projects set compile against .net 4.5.2
  • the build agent compiles code , generates installer has visual studio 2015 , .net 4.6 have necessary .net 4.5.2 framework installed

i believe because .net 4.6 installed machine overriding .net 4.5.2. don't know why happening have seen vaguely similar .net 4.0 application running on machine .net 4.5 installed behaves how .net 4.5 application here (if pretty sure shouldn't be). hoping might able point out missing.

i hope theory wrong.

additional information

i have managed attach debugger when application crashes , error is:

method not found: '!!0[] system.array.empty()'.

there nothing in code uses array.empty().

stacktrace:

at myapp.displayexceptioninfo(exception ex)
@ myapp.main(string[] args) in e:\build\myapp\app.xaml.cs:line 82

displayexceptioninfo tries display exception makes me believe exception being thrown earlier.
main checks see if there instance running through interop (which tried removing did not resolve crash) , creates app class , runs it.

update

sorry don't believe gave enough details in question bottom of issue. turns out teamcity uses msbuild build visual studio solutions , during build there following warning (annoyingly rather buried in log):

[getreferenceassemblypaths] c:\program files (x86)\msbuild\14.0\bin\microsoft.common.currentversion.targets(1097, 5): warning msb3644: reference assemblies framework ".netframework,version=v4.5.2" not found. resolve this, install sdk or targeting pack framework version or retarget application version of framework have sdk or targeting pack installed. note assemblies resolved global assembly cache (gac) , used in place of reference assemblies. therefore assembly may not correctly targeted framework intend.

i can confirm have .net 4.5.2 multi-targeting pack installed continue investigate

after day of investigations appear msbuild building using .net 4.6 framework because cannot find .net 4.5.2 framework installed (although multi-targeting pack installed).

thanks other posts on here there 2 possible solutions both of have worked:

  1. provide frameworkpathoverride msbuild argument.
    -p:frameworkpathoverride="c:\program files (x86)\referenceassemblies\microsoft\framework\.netframework\v4.5.2"
  2. install .net 4.5.2 sdk.

i went option 2 in end although seems visual studio use option 1 when building seems wrong have specify path.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -