I did something similar and worked well with Visual Studio 2010 and on the build server with MsBuild:
<Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> <Directory Id="Gac" Name="Gac"> <Component Id="MiClassDLL" Guid="*"> <File Id="MiClass.dll" Assembly=".net" KeyPath="yes" Source="$(var.MiClass.TargetPath)" /> </Component> <Component Id="PolicyMiClassDLL" Guid="{YOUR_GUID_HERE}"> <File Id="PolicyMiClass.dll" KeyPath="yes" Source="$(var.MiClass.TargetDir)Policy.1.0.MiClass.dll" /> <File Id="PolicyMiClass.config" KeyPath="no" Source="$(var.MiClass.ProjectDir)Policy.1.0.MiClass.config" /> </Component> </Directory> </Directory> </Directory
In my case, I have a policy.config file in the same project directory and I create a policy dll in the same release to simplify the installation of the script.
I noticed that the policy component must have a directive and, for some reason, it internally requires that the policy DLLs and configuration files be in the same directory / component.
I am building a policy assembly in the MiClass project's Post-Build event with this command:
"C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\al.exe" /link:"$(ProjectDir)Policy.1.0.MiClass.config" /out:"$(TargetDir)Policy.1.0.MiClass.dll" /keyfile:"$(SolutionDir)MyKeys.snk" /comp:"My Company" /prod:"My Product" /productv:1.0 /version:1.0.0.0
I hope this works for you.
source share