Hi, Gauthier is right, that's how you'd do it with msbuild. To be specific:
<Reference Include="Newtonsoft.Json" Condition= "'$(BuildConfigKey)'=='NET40'"/> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\lib\NET40\Newtonsoft.Json.dll</HintPath> </Reference> <Reference Include="Newtonsoft.Json" Condition= "'$(BuildConfigKey)'!='NET40'"/> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\lib\NET35\Newtonsoft.Json.Net35.dll</HintPath> </Reference> --Roelof On Tue, Feb 1, 2011 at 12:53 AM, Gauthier Segay <[email protected]>wrote: > Hi John, > > I'm not used with our build script since we moved to msbuild, but I've > a recommendation I can make: > > in a project I was referencing different assemblies according to > target platform (x86 / x64), I did that using the Condition attribute > on the ItemGroup wrapping my references: > > <ItemGroup Condition="'$(Platform)' == 'x86'"> > <Reference Include="ASSEMBLYXYZx86"> > <SpecificVersion>False</SpecificVersion> > <HintPath>..\..\path\to\ASSEMBLYXYZx86.dll</HintPath> > <Private>True</Private> > </Reference> > </ItemGroup> > > it works fine from msbuild invocation, and visual studio, only > drawbacks are > - in the IDE those references looks funky in solution explorer for > some reason > - editing those references with the IDE will remove those condition > attributes > > I assume we can use something similar to detect framework version > > On Jan 31, 11:44 pm, John Simons <[email protected]> wrote: > > While trying to upgrade json.net version to release Json.net 4.0 rc1 and > I've hit a wall and not sure how to fix it! > > > > The problem is that we still compile MR2 against both .net4 and .net35, > so we need 2 different assemblies. > > However the build script expects this 2 assemblies to be named the same > and reside in different folders \lib\net35 or \lib\net40 > > but the new version of json.net is released as Newtonsoft.Json.Net35.dll > (.net 3.5 version) and Newtonsoft.Json.dll (.net 4 version) > > > > So how do I get the build script to pick the right file when we compile > against different versions? > > > > Cheers > > John > > -- > You received this message because you are subscribed to the Google Groups > "Castle Project Development List" group. > To post to this group, send email to [email protected] > . > To unsubscribe from this group, send email to > [email protected]<castle-project-devel%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/castle-project-devel?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Castle Project Development List" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en.
