views:

465

answers:

3

Hi, I've installed powershell v2 ctp3 from the ms download and was wondering where the usual reference assemblies are stored for use in c# for this version. I know for the v1 version they are in program file\etc\reference assemblies\powershell.... but where are they for the v2 ctp3 version. I specifically looking for the new System.Management.Automation.dll

regards Bob.

+1  A: 
Bas Bossink
Hi Bas,I ran your script, and get the same results. Would that suggest that the v2ctp3 aseembly version is 6.1.6949.0. Bob.
scope_creep
Well, that seems to be it. Thanks.Bob.
scope_creep
I'm afraid I don't have any insight into the PowerShell teams versioning strategy but I hope you can move forward with the supplied information.
Bas Bossink
A: 

You should not use the GAC to resolve references. You should find the appropriate references under something like: C:\Program Files\Reference Assemblies\Microsoft\WindowsPowerShell

It is a common myth that assemblies are resolved at Design/Build time in the GAC. Prior to CLR 4.0, you got away with it (because 3.0 and 3.5 are really CLR 2.0). With true multi-targeting this breaks. As such, you should always use reference assemblies.

Also note that reference assemblies do not have to contain any code. They can just be the assembly meta-data and the public symbols.

A: 

Oh, and I meant to add, the GAC is used by the fusion load for Runtime resolution.

By Design/Build time, I mean at the time you are using Visual Studio to build your applicaiton, or are using MSBuild to build your EXE. During the build, we determine the references that are placed in the EXE. Since there may be multiple CLR's involved, we have to make sure the "right" ones are referenced.