Skip to content

Commit d93cb0d

Browse files
committed
Address version conflict in json.net
* Custom build of SimpleRestServices which uses json.net v6 is hosted on myget. * We use SimpleRestServices.1.3.0.1-json6 for our build. * After we build, ilmerge is used to bundle SimpleRestServices with openstacknet.dll. I had to keep the merged SimpleRestServices classes public because our method signatures expose their classes. * Our nuget package distributes the bundled openstacknet.dll. Existing openstack.net users can remove SimpleRestServices from their packages.config and project references, after installing the our new version. If they already had an app.config with binding redirects, those can be removed as well. New openstack.net users will never be exposed to the version conflict and no action is required either now or when the dependency is fully removed.
1 parent 845563e commit d93cb0d

12 files changed

Lines changed: 26 additions & 13 deletions

File tree

NuGet.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
<config>
44
<add key="repositorypath" value="src/packages" />
55
</config>
6+
<packageSources>
7+
<add key="nuget.org" value="https://www.nuget.org/api/v2" />
8+
<add key="OpenStackNetSDK" value="https://www.myget.org/F/openstacknetsdk/api/v2" />
9+
</packageSources>
10+
<activePackageSource>
11+
<add key="All" value="(Aggregate source)" />
12+
</activePackageSource>
613
<packageRestore>
714
<add key="enabled" value="True" />
815
<add key="automatic" value="True" />

build/build.proj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
<Configuration>Debug</Configuration>
66
<Version>1.5.0.0</Version>
77

8+
<ILMerge>$(MSBuildThisFileDirectory.Replace('build\','src'))\packages\ILMerge.2.14.1208\tools\ILMerge.exe</ILMerge>
89
<NuGet>$(LocalAppData)\NuGet\NuGet.exe</NuGet>
910
<MSBuild>&quot;$(MSBuildToolsPath)\MSBuild.exe&quot;</MSBuild>
10-
<XUnit>..\src\packages\xunit.runner.console.2.0.0\tools\xunit.console.exe</XUnit>
11-
<XUnitXslt>..\src\packages\xunit.runner.console.2.0.0\tools\NUnitXml.xslt</XUnitXslt>
11+
<XUnit>$(MSBuildThisFileDirectory.Replace('build\','src'))\packages\xunit.runner.console.2.0.0\tools\xunit.console.exe</XUnit>
12+
<XUnitXslt>$(MSBuildThisFileDirectory.Replace('build\','src'))\packages\xunit.runner.console.2.0.0\tools\NUnitXml.xslt</XUnitXslt>
1213
</PropertyGroup>
1314

1415
<Target Name="CI">
@@ -70,6 +71,10 @@
7071
</Target>
7172

7273
<Target Name="Package" DependsOnTargets="Build;Documentation">
74+
<MakeDir Directories="..\src\corelib\bin\v4.0\$(Configuration)\deploy" />
75+
<Exec Command="$(ILMerge) /t:library /v4 /out:deploy/openstacknet.dll openstacknet.dll SimpleRESTServices.dll"
76+
WorkingDirectory="..\src\corelib\bin\v4.0\$(Configuration)" />
77+
7378
<MakeDir Directories="..\artifacts\packages\" />
7479
<Exec Command="$(NuGet) pack ..\src\corelib\corelib.nuspec -OutputDirectory ..\artifacts\packages -Prop Configuration=$(Configuration) -Version $(Version) -Symbols" />
7580
</Target>

src/Samples/CPPCodeSamples/CPPCodeSamples.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<HintPath>..\..\packages\Newtonsoft.Json.6.0.4\lib\net40\Newtonsoft.Json.dll</HintPath>
7676
</Reference>
7777
<Reference Include="SimpleRESTServices">
78-
<HintPath>..\..\packages\SimpleRESTServices.1.3.0.1\lib\net40\SimpleRESTServices.dll</HintPath>
78+
<HintPath>..\..\packages\SimpleRESTServices.1.3.0.1-json6\lib\net40\SimpleRESTServices.dll</HintPath>
7979
</Reference>
8080
<Reference Include="System" />
8181
<Reference Include="System.Core" />

src/Samples/CSharpCodeSamples/CSharpCodeSamples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</Reference>
4141
<Reference Include="SimpleRESTServices, Version=1.3.0.0, Culture=neutral, PublicKeyToken=8965cea5c205d3a3, processorArchitecture=MSIL">
4242
<SpecificVersion>False</SpecificVersion>
43-
<HintPath>..\..\packages\SimpleRESTServices.1.3.0.1\lib\net40\SimpleRESTServices.dll</HintPath>
43+
<HintPath>..\..\packages\SimpleRESTServices.1.3.0.1-json6\lib\net40\SimpleRESTServices.dll</HintPath>
4444
</Reference>
4545
<Reference Include="System" />
4646
<Reference Include="System.Core" />

src/Samples/FSharpCodeSamples/FSharpCodeSamples.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<Private>True</Private>
6868
</Reference>
6969
<Reference Include="SimpleRESTServices">
70-
<HintPath>..\..\packages\SimpleRESTServices.1.3.0.1\lib\net40\SimpleRESTServices.dll</HintPath>
70+
<HintPath>..\..\packages\SimpleRESTServices.1.3.0.1-json6\lib\net40\SimpleRESTServices.dll</HintPath>
7171
<Private>True</Private>
7272
</Reference>
7373
<Reference Include="System" />

src/Samples/VBCodeSamples/VBCodeSamples.vbproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
</Reference>
5454
<Reference Include="SimpleRESTServices, Version=1.3.0.0, Culture=neutral, PublicKeyToken=8965cea5c205d3a3, processorArchitecture=MSIL">
5555
<SpecificVersion>False</SpecificVersion>
56-
<HintPath>..\..\packages\SimpleRESTServices.1.3.0.1\lib\net40\SimpleRESTServices.dll</HintPath>
56+
<HintPath>..\..\packages\SimpleRESTServices.1.3.0.1-json6\lib\net40\SimpleRESTServices.dll</HintPath>
5757
</Reference>
5858
<Reference Include="System" />
5959
<Reference Include="System.Data" />

src/corelib/OpenStack.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
</Reference>
6767
<Reference Include="SimpleRESTServices, Version=1.3.0.0, Culture=neutral, PublicKeyToken=8965cea5c205d3a3, processorArchitecture=MSIL">
6868
<SpecificVersion>False</SpecificVersion>
69-
<HintPath>..\packages\SimpleRESTServices.1.3.0.1\lib\net40\SimpleRESTServices.dll</HintPath>
69+
<HintPath>..\packages\SimpleRESTServices.1.3.0.1-json6\lib\net40\SimpleRESTServices.dll</HintPath>
7070
</Reference>
7171
<Reference Include="System" />
7272
<Reference Include="System.Core" />

src/corelib/corelib.nuspec

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
<tags>openstack</tags>
1616
<dependencies>
1717
<group targetFramework="4.5">
18-
<dependency id="SimpleRESTServices" version="[1.3.0.1]" />
1918
<dependency id="Newtonsoft.Json" version="6.0.4" />
2019
<dependency id="Flurl.Http.Signed" version="0.6.2.2015062601" />
2120
<dependency id="Marvin.JsonPatch.Signed" version="0.7.0" />
@@ -25,8 +24,8 @@
2524
<files>
2625

2726
<!-- Runtime libraries -->
28-
<file src="bin\v4.0\$Configuration$\openstacknet.dll" target="lib\net45"/>
29-
<file src="bin\v4.0\$Configuration$\openstacknet.pdb" target="lib\net45"/>
27+
<file src="bin\v4.0\$Configuration$\deploy\openstacknet.dll" target="lib\net45"/>
28+
<file src="bin\v4.0\$Configuration$\deploy\openstacknet.pdb" target="lib\net45"/>
3029
<file src="..\..\artifacts\docs\Api\v4.0\openstacknet.xml" target="lib\net45"/>
3130

3231
<!-- Source code -->

src/corelib/packages.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
<package id="Flurl.Signed" version="1.0.8" targetFramework="net45" />
55
<package id="Marvin.JsonPatch.Signed" version="0.7.0" targetFramework="net45" />
66
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
7-
<package id="SimpleRESTServices" version="1.3.0.1" targetFramework="net40" />
7+
<package id="SimpleRESTServices" version="1.3.0.1-json6" targetFramework="net40" />
8+
<package id="ILMerge" version="2.14.1208" targetFramework="net40" />
89
</packages>

src/openstack.net.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ EndProject
2626
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{EFFA0DAE-1829-4783-92CF-390CFCE22E43}"
2727
ProjectSection(SolutionItems) = preProject
2828
..\build\build.proj = ..\build\build.proj
29+
..\NuGet.config = ..\NuGet.config
2930
EndProjectSection
3031
EndProject
3132
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenStack", "corelib\OpenStack.csproj", "{1A4FB67F-8642-4402-B931-118955AE7538}"

0 commit comments

Comments
 (0)