Skip to content

Commit 8491ab6

Browse files
committed
Fix WinRT build errors.
1 parent ab50269 commit 8491ab6

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

src/MsgPack/Serialization/SerializationContext.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
using System.Diagnostics.Contracts;
3636
#endif // XAMIOS || XAMDROID
3737
#endif // !UNITY
38-
#if UNITY
38+
#if UNITY || NETFX_CORE
3939
using System.Linq;
40-
#endif // UNITY
40+
#endif // UNITY || NETFX_CORE
4141
#if NETFX_CORE
4242
using System.Linq.Expressions;
4343
#endif // NETFX_CORE
44-
#if UNITY || XAMIOS || XAMDROID
44+
#if UNITY || XAMIOS || XAMDROID || NETFX_CORE
4545
using System.Reflection;
46-
#endif // UNITY || XAMIOS || XAMDROID
46+
#endif // UNITY || XAMIOS || XAMDROID || NETFX_CORE
4747
using System.Threading;
4848

4949
using MsgPack.Serialization.DefaultSerializers;
@@ -554,7 +554,7 @@ internal bool ContainsSerializer( Type rootType )
554554
{
555555
return
556556
this._serializers.Contains( rootType )
557-
|| ( rootType.IsGenericType && this._serializers.Contains( rootType.GetGenericTypeDefinition() ) );
557+
|| ( rootType.GetIsGenericType() && this._serializers.Contains( rootType.GetGenericTypeDefinition() ) );
558558
}
559559

560560
/// <summary>

test/MsgPack.UnitTest.BclExtensions.WinRT/MsgPack.UnitTest.BclExtensions.WinRT.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,9 @@
157157
</ProjectReference>
158158
</ItemGroup>
159159
<ItemGroup>
160-
<Reference Include="System.Collections.Immutable">
161-
<HintPath>..\..\packages\Microsoft.Bcl.Immutable.1.0.30\lib\portable-net45+win8+wp8\System.Collections.Immutable.dll</HintPath>
160+
<Reference Include="System.Collections.Immutable, Version=1.1.37.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
161+
<HintPath>..\..\packages\System.Collections.Immutable.1.1.37\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
162+
<Private>True</Private>
162163
</Reference>
163164
</ItemGroup>
164165
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '11.0' ">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Microsoft.Bcl.Immutable" version="1.0.30" targetFramework="win" />
3+
<package id="System.Collections.Immutable" version="1.1.37" targetFramework="win" />
44
</packages>

test/MsgPack.UnitTest/Serialization/SerializationContextTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,9 @@ public void TestResolveSerializer_SetNull_Generated()
436436
var result = context.GetSerializer<Image>();
437437
Assert.That( raised, Is.EqualTo( 1 ) );
438438
Assert.That( result, Is.Not.Null );
439-
#if !NETFX_35 && !UNITY
440-
Assert.That( result.GetType().Assembly.IsDynamic );
441-
#endif // !NETFX_35 && !UNITY
439+
#if !NETFX_35 && !UNITY && !NETFX_CORE && !SILVERLIGHT
440+
Assert.That( result.GetType().GetAssembly().IsDynamic );
441+
#endif // !NETFX_35 && !UNITY && !NETFX_CORE && !SILVERLIGHT
442442
}
443443

444444

test/MsgPack.UnitTest/Serialization/VersioningTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private static void TestExtraFieldCore( SerializationMethod method, EmitterFlavo
7272
packer.Pack("Extra1");
7373
packer.Pack(String40);
7474
packer.Pack("Extra2");
75-
packer.Pack(System.Text.UTF8Encoding.Default.GetBytes(String40));
75+
packer.Pack(System.Text.Encoding.UTF8.GetBytes(String40));
7676
packer.Pack("Field2");
7777
packer.Pack( -1 );
7878
packer.Pack("Extra3");

0 commit comments

Comments
 (0)