Skip to content

Commit 959afab

Browse files
committed
Fix nuget references for WP 8.1 projects.
Suppress errors in WinRT disconnecting from sockets. Fix assembly & namespace names for various platforms.
1 parent 413a4c5 commit 959afab

File tree

10 files changed

+48
-55
lines changed

10 files changed

+48
-55
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,4 @@ FakesAssemblies/
211211
GeneratedArtifacts/
212212
_Pvt_Extensions/
213213
ModelManifest.xml
214+
/src/Yort.Ntp.Android/Yort.Ntp.Android.csproj.bak

Yort.Ntp.Portable.nuspec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package >
33
<metadata>
44
<id>Yort.Ntp.Portable</id>
5-
<version>1.0.6</version>
5+
<version>1.0.7</version>
66
<authors>Yortw</authors>
77
<owners>Troy Willmot</owners>
88
<licenseUrl>https://github.com/Yortw/Yort.Ntp/blob/master/LICENSE.md</licenseUrl>
@@ -46,6 +46,11 @@
4646
<file src="src\Yort.Ntp.WinRT\bin\Release\Yort*.dll" target="lib\netcore451" />
4747
<file src="src\Yort.Ntp.WinRT\bin\Release\Yort*.xml" exclude="**\*.codeanalysislog.xml" target="lib\netcore451" />
4848
<file src="src\Yort.Ntp.WinRT\bin\Release\Yort*.pdb" target="lib\netcore451" />
49+
50+
<file src="src\Yort.Ntp.WinRT\bin\Release\Yort*.dll" target="lib\wpa81" />
51+
<file src="src\Yort.Ntp.WinRT\bin\Release\Yort*.xml" exclude="**\*.codeanalysislog.xml" target="lib\wpa81" />
52+
<file src="src\Yort.Ntp.WinRT\bin\Release\Yort*.pdb" target="lib\wpa81" />
53+
4954
<file src="src\**\*.cs" exclude="**\obj\**\*.*" target="src" />
5055
</files>
5156
</package>

nuget-push.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
.nuget\nuget push Yort.Ntp.Portable.1.0.6.nupkg
1+
.nuget\nuget push Yort.Ntp.Portable.1.0.7.nupkg
22
pause

src/Yort.Ntp.Android/Resources/Resource.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Yort.Ntp.Android/Yort.Ntp.Android.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1010
<OutputType>Library</OutputType>
1111
<AppDesignerFolder>Properties</AppDesignerFolder>
12-
<RootNamespace>Yort.Ntp.Android</RootNamespace>
12+
<RootNamespace>Yort.Ntp</RootNamespace>
1313
<AssemblyName>Yort.Ntp</AssemblyName>
1414
<FileAlignment>512</FileAlignment>
1515
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
1616
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
1717
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
18-
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
18+
<TargetFrameworkVersion>v6.0</TargetFrameworkVersion>
1919
</PropertyGroup>
2020
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2121
<DebugSymbols>true</DebugSymbols>

src/Yort.Ntp.Net45/Yort.Ntp.Net45.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<ProjectGuid>{B0012C48-36AF-4D5D-980F-44BAC0313952}</ProjectGuid>
88
<OutputType>Library</OutputType>
99
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>Yort.Ntp.Net45</RootNamespace>
11-
<AssemblyName>Yort.Ntp.Net45</AssemblyName>
10+
<RootNamespace>Yort.Ntp</RootNamespace>
11+
<AssemblyName>Yort.Ntp</AssemblyName>
1212
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
</PropertyGroup>
@@ -20,7 +20,7 @@
2020
<DefineConstants>TRACE;DEBUG;CODE_ANALYSIS;CODE_ANALYSIS;SUPPORTS_TASKASYNC;SUPPORTS_SERIALISATION;SUPPORTS_TASKDELAY;SUPPORTS_COMVISIBLE</DefineConstants>
2121
<ErrorReport>prompt</ErrorReport>
2222
<WarningLevel>4</WarningLevel>
23-
<DocumentationFile>bin\Debug\Yort.Ntp.Net45.XML</DocumentationFile>
23+
<DocumentationFile>bin\Debug\Yort.Ntp.xml</DocumentationFile>
2424
<RunCodeAnalysis>true</RunCodeAnalysis>
2525
<CodeAnalysisRuleSet>..\Yort.Ntp.CodeAnalysis.ruleset</CodeAnalysisRuleSet>
2626
</PropertyGroup>
@@ -31,7 +31,7 @@
3131
<DefineConstants>TRACE;CODE_ANALYSIS;CODE_ANALYSIS;SUPPORTS_TASKASYNC;SUPPORTS_SERIALISATION;SUPPORTS_TASKDELAY;SUPPORTS_COMVISIBLE</DefineConstants>
3232
<ErrorReport>prompt</ErrorReport>
3333
<WarningLevel>4</WarningLevel>
34-
<DocumentationFile>bin\Release\Yort.Ntp.Net45.XML</DocumentationFile>
34+
<DocumentationFile>bin\Release\Yort.Ntp.xml</DocumentationFile>
3535
<RunCodeAnalysis>true</RunCodeAnalysis>
3636
<CodeAnalysisRuleSet>..\Yort.Ntp.CodeAnalysis.ruleset</CodeAnalysisRuleSet>
3737
</PropertyGroup>

src/Yort.Ntp.SharedImplementation/AssemblyInfoCommon.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// Build Number
3333
// Revision
3434
//
35-
[assembly: AssemblyVersion("1.0.0.6")]
36-
[assembly: AssemblyFileVersion("1.0.0.6")]
35+
[assembly: AssemblyVersion("1.0.0.7")]
36+
[assembly: AssemblyFileVersion("1.0.0.7")]

src/Yort.Ntp.WPSL/Yort.Ntp.WPSL.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
1010
<OutputType>Library</OutputType>
1111
<AppDesignerFolder>Properties</AppDesignerFolder>
12-
<RootNamespace>Yort.Ntp.WPSL</RootNamespace>
13-
<AssemblyName>Yort.Ntp.WPSL</AssemblyName>
12+
<RootNamespace>Yort.Ntp</RootNamespace>
13+
<AssemblyName>Yort.Ntp</AssemblyName>
1414
<TargetFrameworkIdentifier>WindowsPhone</TargetFrameworkIdentifier>
1515
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
1616
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
@@ -29,7 +29,7 @@
2929
<NoConfig>true</NoConfig>
3030
<ErrorReport>prompt</ErrorReport>
3131
<WarningLevel>4</WarningLevel>
32-
<DocumentationFile>Bin\Debug\Yort.Ntp.WPSL.XML</DocumentationFile>
32+
<DocumentationFile>Bin\Debug\Yort.Ntp.xml</DocumentationFile>
3333
<RunCodeAnalysis>true</RunCodeAnalysis>
3434
<CodeAnalysisRuleSet>..\Yort.Ntp.CodeAnalysis.ruleset</CodeAnalysisRuleSet>
3535
</PropertyGroup>
@@ -42,7 +42,7 @@
4242
<NoConfig>true</NoConfig>
4343
<ErrorReport>prompt</ErrorReport>
4444
<WarningLevel>4</WarningLevel>
45-
<DocumentationFile>Bin\Release\Yort.Ntp.WPSL.XML</DocumentationFile>
45+
<DocumentationFile>Bin\Release\Yort.Ntp.xml</DocumentationFile>
4646
<RunCodeAnalysis>true</RunCodeAnalysis>
4747
<CodeAnalysisRuleSet>..\Yort.Ntp.CodeAnalysis.ruleset</CodeAnalysisRuleSet>
4848
</PropertyGroup>
Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,33 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
3-
4-
<Identity Name="8c98d76b-4bb1-4ce5-9ab9-652eca513089"
5-
Publisher="CN=Troy"
6-
Version="1.0.0.0" />
7-
2+
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
3+
<Identity Name="8c98d76b-4bb1-4ce5-9ab9-652eca513089" Publisher="CN=Troy" Version="1.0.0.0" />
84
<Properties>
95
<DisplayName>Yort.Ntp.WinRT.Tests</DisplayName>
106
<PublisherDisplayName>Troy</PublisherDisplayName>
117
<Logo>Images\UnitTestStoreLogo.png</Logo>
128
<Description>Yort.Ntp.WinRT.Tests</Description>
139
</Properties>
14-
1510
<Prerequisites>
1611
<OSMinVersion>6.3.0</OSMinVersion>
1712
<OSMaxVersionTested>6.3.0</OSMaxVersionTested>
1813
</Prerequisites>
19-
2014
<Resources>
21-
<Resource Language="x-generate"/>
15+
<Resource Language="x-generate" />
2216
</Resources>
23-
2417
<Applications>
25-
<Application Id="vstest.executionengine.App"
26-
Executable="vstest.executionengine.appcontainer.exe"
27-
EntryPoint="vstest.executionengine.App">
28-
<VisualElements
29-
DisplayName="NoUIEntryPoints"
30-
Logo="Images\UnitTestLogo.png"
31-
SmallLogo="Images\UnitTestSmallLogo.png"
32-
Description="vstest.executionengine.App"
33-
ForegroundText="light"
34-
BackgroundColor="#0084FF">
35-
<SplashScreen Image="Images\UnitTestSplashScreen.png" />
36-
</VisualElements>
18+
<Application Id="vstest.executionengine.App" Executable="vstest.executionengine.appcontainer.exe" EntryPoint="vstest.executionengine.App">
19+
<m2:VisualElements DisplayName="NoUIEntryPoints" Description="vstest.executionengine.App" BackgroundColor="#0084FF" ForegroundText="light" Square150x150Logo="Images\UnitTestLogo.png" Square30x30Logo="Images\UnitTestSmallLogo.png">
20+
<m2:SplashScreen Image="Images\UnitTestSplashScreen.png" />
21+
</m2:VisualElements>
3722
</Application>
38-
39-
<Application Id="vstest.executionengine.x86.App"
40-
Executable="vstest.executionengine.appcontainer.x86.exe"
41-
EntryPoint="vstest.executionengine.x86.App">
42-
<VisualElements
43-
DisplayName="NoUIEntryPoints"
44-
Logo="Images\UnitTestLogo.png"
45-
SmallLogo="Images\UnitTestSmallLogo.png"
46-
Description="vstest.executionengine.x86.App"
47-
ForegroundText="light"
48-
BackgroundColor="#0084FF">
49-
<SplashScreen Image="Images\UnitTestSplashScreen.png" />
50-
</VisualElements>
23+
<Application Id="vstest.executionengine.x86.App" Executable="vstest.executionengine.appcontainer.x86.exe" EntryPoint="vstest.executionengine.x86.App">
24+
<VisualElements DisplayName="NoUIEntryPoints" Logo="Images\UnitTestLogo.png" SmallLogo="Images\UnitTestSmallLogo.png" Description="vstest.executionengine.x86.App" ForegroundText="light" BackgroundColor="#0084FF">
25+
<SplashScreen Image="Images\UnitTestSplashScreen.png" />
26+
</VisualElements>
5127
</Application>
5228
</Applications>
5329
<Capabilities>
5430
<Capability Name="internetClient" />
31+
<Capability Name="internetClientServer" />
5532
</Capabilities>
56-
</Package>
33+
</Package>

src/Yort.Ntp.WinRT/NtpClientWinRTSockets.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ async partial void SendTimeRequest()
4646
{
4747
if (socket != null)
4848
{
49-
socket.MessageReceived -= this.Socket_Completed_Receive;
50-
socket.Dispose();
49+
ExecuteWithSuppressedExceptions(() => socket.MessageReceived -= this.Socket_Completed_Receive);
50+
ExecuteWithSuppressedExceptions(() => socket.Dispose());
5151
}
5252
}
5353
finally
@@ -66,7 +66,7 @@ private void Socket_Completed_Receive(Windows.Networking.Sockets.DatagramSocket
6666
{
6767
try
6868
{
69-
sender.MessageReceived -= this.Socket_Completed_Receive;
69+
ExecuteWithSuppressedExceptions(() => sender.MessageReceived -= this.Socket_Completed_Receive);
7070

7171
byte[] buffer = null;
7272
using (var reader = args.GetDataReader())
@@ -88,6 +88,16 @@ private static NtpNetworkException ExceptionToNtpNetworkException(Exception ex)
8888
return new NtpNetworkException(ex.Message, (int)SocketError.GetStatus(ex.HResult), ex);
8989
}
9090

91+
private void ExecuteWithSuppressedExceptions(Action work)
92+
{
93+
try
94+
{
95+
work();
96+
}
97+
catch (OutOfMemoryException) { throw; }
98+
catch { }
99+
}
100+
91101
#region Private Classes
92102

93103
private sealed class AsyncUdpResult : IDisposable

0 commit comments

Comments
 (0)