I am having some issues building a merged DLL to target .net4.0 on a windows 8 machine. I can successfully build individual .net4.0 dlls in VS2012 so I do not have this problem:
Targeting .NET 4.0 in VS 2012 on Windows 8
I have come across the following excellent blog post which discuss my issue:
and also:
Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib
which suggests I use the following syntax during the merge:
/targetplatform:"v4,C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"
Unfortunately in windows 8 I do not have this directory. I can think of the following possible solutions but would be interested to know if anyone has already solved this.
Many thanks for the comments and feedback. A working (hacky) solution was to do the following:
C:\Program Files\Reference Assemblies\Microsoft\Framework\v4.0
.C:\Windows\Microsoft.NET\Framework\v4.0.30319
I was then able to correctly reference the .net4.0 assemblies in Windows 8 using the following:
/targetplatform:"v4,C:\Program Files\Reference Assemblies\Microsoft\Framework\v4.0"
Tested as working ok.