adding frameworkAssembly entry with CopyLocal=True


Any pointers on how i configure my Package.nuspec frameworkAssembly entry such that it adds it to the project with CopyLocal=True set?

In the case of the nfx45/wif45 System.IdentityModel.Services assembly i'm finding that i have to configure copyLocal=True in order for it to be found and work at runtime.
  <frameworkAssembly assemblyName="Microsoft.Web.Infrastructure" targetFramework=".NETFramework4.0" />
  <frameworkAssembly assemblyName="System.IdentityModel" targetFramework=".NETFramework4.0" />
  <frameworkAssembly assemblyName="System.IdentityModel.Services" targetFramework=".NETFramework4.0" />
<!-- C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.IdentityModel.Services.dll -->


robertob wrote Feb 15, 2013 at 6:54 PM

As my interim work around I added the following line to my Tools\install.ps1 script. As noted in the inline comment it seems I only need this unexpected CopyLocal=True setting in the case of when types provided by that framework assembly are referenced in App_Code/.cs compiled at runtime sources. For some reason I didn't hit this issue in the case of other framework assembly types used in my App_Code/.cs compiled at runtime sources so it seems like a requirement specific to this new nfx45 assembly and only in App_Code sources, i.e. it doesn't need CopyLocal=True in the case of build time compiled source file usage.

$project.Object.References.Item("System.IdentityModel.Services").CopyLocal = "True" # necessary for App_Code/SignInRequestResponseValidator.cs otherwise get runtime compilation errors