Reputation: 3299
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.
Upvotes: 1
Views: 1185
Reputation: 3299
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.
Upvotes: 1
Reputation: 592
I am also using Windows 8, and VS 2012 but have not come across that issue (and surely, a bunch of other people are fine as well). Very simply, it may just be that you have v3.5 or v4.5 installed and that means you need to install v4.0 framework (... again if you already tried).
I also found that the folder path you gave did not take me anywhere on my PC, but this path did;
C:\Program Files\Reference Assemblies\Microsoft\Framework\
Can you try that path on your PC and see if there is a v4.0 folder there.
Upvotes: 1