Skip to content

Commit

Permalink
Updated with latest library and updated code not to use obsolete api
Browse files Browse the repository at this point in the history
- Compiled with VS2017 (.NET 4.6.2)
- Updated AWSSDK.Core v3.3.104.15
- Updated AWSSDK.Route53 v3.3.102.68
- Updated Topshelf V4.2.1
- Updated Unity v5.11.3
- Updated CommonServiceLocator v2.0.5
  • Loading branch information
RiniBoo committed Jan 12, 2020
1 parent bf62095 commit a156114
Show file tree
Hide file tree
Showing 9 changed files with 140 additions and 92 deletions.
4 changes: 2 additions & 2 deletions DynamicDnsUpdater.Service.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30723.0
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamicDnsUpdater.Service", "DynamicDnsUpdater.Service\DynamicDnsUpdater.Service.csproj", "{FF83763D-0870-4F80-ADBD-141D70E0CE5A}"
EndProject
Expand Down
88 changes: 56 additions & 32 deletions DynamicDnsUpdater.Service/App.config
Original file line number Diff line number Diff line change
@@ -1,71 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true"/>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<appSettings>
<!-- Update Settings -->
<add key="XmlConfigFileName" value="XmlConfig.xml"/>
<add key="UpdateIntervalInMinutes" value="6"/>
<add key="XmlConfigFileName" value="XmlConfig.xml" />
<!-- UpdateIntervalInMinutes must be GREATER THAN MinimalUpdateIntervalInMinutes in XmlConfig, if both values are EQUAL it will not update until next cycle -->
<add key="MonitorStatusInMinutes" value="1"/>
<add key="ClientTimeoutInMinutes" value="1"/>
<add key="ForceUpdateInDays" value="30"/>
<add key="UpdateIntervalInMinutes" value="6" />
<add key="MonitorStatusInMinutes" value="1" />
<add key="ClientTimeoutInMinutes" value="1" />
<add key="ForceUpdateInDays" value="30" />
<!-- Notification -->
<add key="FromEmail" value="[email protected]"/>
<add key="ToEmail" value="[email protected]"/>
<add key="Password" value="shabby variable gangland airspeed decode"/>
<add key="Subject" value="[DnsUpdater] IP has been updated"/>
<add key="Host" value="mail.dkw.io"/>
<add key="Port" value="587"/>
<!-- EnablePasswordEncryption is to protect the Notification's "Password" in this App.config and XmlConfig.xml's "SecretKey". To use this:
1. Set this flag to true
2. Update your own ConfigHelper.EncryptionKey and
<add key="FromEmail" value="[email protected]" />
<add key="ToEmail" value="[email protected]" />
<add key="Password" value="password" />
<add key="Subject" value="[DnsUpdater] IP has been updated" />
<add key="Host" value="smtp.gmail.com" />
<add key="Port" value="587" />
<!-- EnablePasswordEncryption is to protect the Notification's "Password" in this App.config and XmlConfig.xml's "SecretKey". To use this:
1. Set this flag to true
2. Update your own ConfigHelper.EncryptionKey and
3. Use Des3.Encrypt() to encrypt your plaintext Password/SecretKey -->
<add key="EnablePasswordEncryption" value="false"/>
<!--AWSProfileName is used to reference an account that has been registered with the SDK.
If using AWS Toolkit for Visual Studio then this value is the same value shown in the AWS Explorer.
It is also possible to register an account using the <solution-dir>/packages/AWSSDK-X.X.X.X/tools/account-management.ps1 PowerShell script
that is bundled with the nuget package under the tools folder.
<add key="AWSProfileName" value="" />
-->
<add key="EnablePasswordEncryption" value="false" />
<!--
This AWSProfileName was added automatically when using NuGet Update to the latest version of AWS SDK
AWSProfileName is used to reference an account that has been registered with the SDK.
If using AWS Toolkit for Visual Studio then this value is the same value shown in the AWS Explorer.
It is also possible to register an account using the <solution-dir>/packages/AWSSDK-X.X.X.X/tools/account-management.ps1 PowerShell script
that is bundled with the nuget package under the tools folder.
<add key="AWSProfileName" value="" />
-->
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="General">
<listeners>
<!-- Rolling file listener as Text Formatter -->
<add name="RollingFile" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" fileName="c:\Logs\DnsUpdaterService.log" footer="" formatter="TextFormatter" header="" rollFileExistsBehavior="Increment" rollInterval="Midnight"/>
<add name="RollingFile" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" fileName="c:\Logs\DnsUpdaterService\DnsUpdaterService.log" footer="" formatter="TextFormatter" header="" rollFileExistsBehavior="Increment" rollInterval="Midnight" />
<!-- Logging errors file, records errors encountered by the logging system -->
<add name="ErrorsFile" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging,Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging,Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" fileName="c:\Logs\DnsUpdaterError.log"/>
<add name="ErrorsFile" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging,Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging,Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" fileName="c:\Logs\DnsUpdaterService\DnsUpdaterError.log" />
</listeners>
<!-- Formatter using server local time, remove local from template to use UTC -->
<formatters>
<add name="TextFormatter" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" template="{timestamp(local:yyyy-MM-dd HH:mm:ss)} {category} {priority} {message}"/>
<add name="TextFormatter" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" template="{timestamp(local:yyyy-MM-dd HH:mm:ss)} {category} {priority} {message}" />
</formatters>
<!-- Category Sources -->
<categorySources>
<add switchValue="All" name="General">
<listeners>
<add name="RollingFile"/>
<add name="RollingFile" />
</listeners>
</add>
</categorySources>
<specialSources>
<!-- allEvents: Intentionally not bind to any listener -->
<allEvents switchValue="All" name="All Events"/>
<allEvents switchValue="All" name="All Events" />
<notProcessed switchValue="All" name="Unprocessed Category">
<listeners>
<add name="RollingFile"/>
<add name="RollingFile" />
</listeners>
</notProcessed>
<errors switchValue="All" name="Logging Errors and Warnings">
<listeners>
<add name="ErrorsFile"/>
<add name="ErrorsFile" />
</listeners>
</errors>
</specialSources>
</loggingConfiguration>
</configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
</configuration>
71 changes: 34 additions & 37 deletions DynamicDnsUpdater.Service/DynamicDnsUpdater.Service.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DynamicDnsUpdater.Service</RootNamespace>
<AssemblyName>DynamicDnsUpdater.Service</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand All @@ -33,51 +33,46 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AWSSDK.Core, Version=3.1.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604, processorArchitecture=MSIL">
<HintPath>..\packages\AWSSDK.Core.3.1.5.3\lib\net45\AWSSDK.Core.dll</HintPath>
<Private>True</Private>
<Reference Include="AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604, processorArchitecture=MSIL">
<HintPath>..\packages\AWSSDK.Core.3.3.104.15\lib\net45\AWSSDK.Core.dll</HintPath>
</Reference>
<Reference Include="AWSSDK.Route53, Version=3.1.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604, processorArchitecture=MSIL">
<HintPath>..\packages\AWSSDK.Route53.3.1.4.0\lib\net45\AWSSDK.Route53.dll</HintPath>
<Private>True</Private>
<Reference Include="AWSSDK.Route53, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604, processorArchitecture=MSIL">
<HintPath>..\packages\AWSSDK.Route53.3.3.102.68\lib\net45\AWSSDK.Route53.dll</HintPath>
</Reference>
<Reference Include="CommonServiceLocator, Version=2.0.5.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..\packages\CommonServiceLocator.2.0.5\lib\net46\CommonServiceLocator.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.EnterpriseLibrary.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EnterpriseLibrary.Common.6.0.1304.0\lib\NET45\Microsoft.Practices.EnterpriseLibrary.Common.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\EnterpriseLibrary.Logging.6.0.1304.0\lib\NET45\Microsoft.Practices.EnterpriseLibrary.Logging.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Practices.Unity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f, processorArchitecture=MSIL">
<HintPath>..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Practices.Unity.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f, processorArchitecture=MSIL">
<HintPath>..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.Configuration.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Practices.Unity.RegistrationByConvention, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f, processorArchitecture=MSIL">
<HintPath>..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.RegistrationByConvention.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.7.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Topshelf, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b800c4cfcdeea87b, processorArchitecture=MSIL">
<HintPath>..\packages\Topshelf.4.0.1\lib\net452\Topshelf.dll</HintPath>
<Private>True</Private>
<Reference Include="Topshelf, Version=4.2.1.215, Culture=neutral, PublicKeyToken=b800c4cfcdeea87b, processorArchitecture=MSIL">
<HintPath>..\packages\Topshelf.4.2.1\lib\net452\Topshelf.dll</HintPath>
</Reference>
<Reference Include="Unity.Abstractions, Version=5.11.3.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..\packages\Unity.5.11.3\lib\net46\Unity.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Unity.Container, Version=5.11.5.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..\packages\Unity.5.11.3\lib\net46\Unity.Container.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand All @@ -104,24 +99,26 @@
<Compile Include="Providers\AmazonRoute53DnsProvider.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\AWSSDK.Route53.3.1.4.0\analyzers\dotnet\cs\AWSSDK.Route53.CodeAnalysis.dll" />
</ItemGroup>
<ItemGroup>
<Content Include="XmlConfig.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\AWSSDK.Route53.3.3.102.68\analyzers\dotnet\cs\AWSSDK.Route53.CodeAnalysis.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
26 changes: 20 additions & 6 deletions DynamicDnsUpdater.Service/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@
//
// Architecture and Installation: See CodeProject and GitHub
//
// Pre-req: Visual Studio 2013 with .NET Framework 4.5 (full, not client profile)
// Compile: Enable NuGet to restore package
//
// Article: http://www.codeproject.com/Articles/882487/Amazon-AWS-Route-Dynamic-IP-Updater-Windows-Service
// Source : https://github.com/riniboo/DynamicDnsUpdaterService
//
// License: The GNU General Public License v3.0
//
// Written and Created By: Rini Boo
// Created on: 2015-03-04
//
Expand All @@ -27,6 +22,25 @@
// - NuGet Update Topshelf 3.1.4 to 3.3.31
// - NuGet Update Unity 3.5.1404 to 4.0.1

// 2016-05-18 (ver 1.0.0.3):
// dougkwilson on GitHub updated .NET v4.6.1, Topshelf v4.0.1 and AWSSDK v3

// 2016-11-07 (ver 1.0.0.4):
// - Compiled with VS2015 (.NET 4.6.1)
// - NuGet Update on Topshelf to 4.0.3
// - Uninstall Amazon AWS 2.3.53 and Installed AWSSDK.Route53 (3.3.1.1)
// - Newtonsoft.Json.dll is needed from JavaScriptSerializer (Json.NET)
// - Replace AWSClientFactory.CreateAmazonRoute53Client (AWS obsolete API) with new AmazonRoute53Client

// 2020-01-12 (ver 1.0.0.5):
// - Compiled with VS2017 (.NET 4.6.2), \v4.6.2\System.Web.Extensions.dll has JavaScriptSerializer
// - Updated AWSSDK.Core v3.3.104.15
// - Updated AWSSDK.Route53 v3.3.102.68
// - Updated Topshelf V4.2.1
// - Updated Unity v5.11.3
// - Updated CommonServiceLocator v2.0.5
// - It automatically added System.Runtime.CompilerServices.Unsafe.4.7.0

using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -59,7 +73,7 @@ public static void Main()
x.RunAsLocalSystem();

x.SetDescription("Update current IP address supports multiple DNS providers");
x.SetDisplayName("Dynamic DNS Updater Service");
x.SetDisplayName("DynamicDnsUpdater.Service");
x.SetServiceName("DynamicDnsUpdater");
});

Expand Down
6 changes: 3 additions & 3 deletions DynamicDnsUpdater.Service/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DynamicDnsUpdater.Service")]
[assembly: AssemblyCopyright("Copyright © 2015 Rini Boo")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.2")]
[assembly: AssemblyFileVersion("1.0.0.2")]
[assembly: AssemblyVersion("1.0.0.5")]
[assembly: AssemblyFileVersion("1.0.0.5")]
Loading

0 comments on commit a156114

Please sign in to comment.