Perhaps a dump question (But I’m not a super experienced user of .NET), but it seems I have identical (or nearly so) versions of .NET 4.0 in two different places on my machine:
- C:\Windows\Microsoft.NET\Framework\v4.0.30319
-
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0
-
In visual studio, when I go to add a reference for a C++/CLI project, it takes me to directory #2.
-
Also in visual studio, I can specify an assembly path to resolve #using References, (which allows me to use the symbolic paths in the property pages). There in can use the macro $(FrameworkDir) which resolves (at least on my machine) to C:\Windows\Microsoft.NET\Framework\ which is basically directory #1.
-
So which one should I use?
First and foremost, you should use the Add New Reference dialog, .NET tab. It is configured by the installer to present the correct ones.
For 4.0, you should always use 2, it contains the version isolated reference assemblies. They are special, not just a copy but stripped down to the metadata. They prevent you from accidentally using a public method or property that was added in a service pack. And break your program when it runs on a machine without the service pack. WaitHandle.WaitOne(int) was infamous for that, only available in .NET 2.0 SP2