Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to .NET Standard 2.0 #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .vs/slnx.sqlite
Binary file not shown.
15 changes: 9 additions & 6 deletions HubConnectionManager.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.31101.0
# Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HubConnectionManager", "HubConnectionManager\HubConnectionManager.csproj", "{687CDF73-8065-4AC8-96C6-4B872EC73E8F}"
EndProject
Expand All @@ -26,12 +26,12 @@ Global
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{687CDF73-8065-4AC8-96C6-4B872EC73E8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{687CDF73-8065-4AC8-96C6-4B872EC73E8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{687CDF73-8065-4AC8-96C6-4B872EC73E8F}.Debug|x86.ActiveCfg = Debug|x86
{687CDF73-8065-4AC8-96C6-4B872EC73E8F}.Debug|x86.Build.0 = Debug|x86
{687CDF73-8065-4AC8-96C6-4B872EC73E8F}.Debug|x86.ActiveCfg = Debug|Any CPU
{687CDF73-8065-4AC8-96C6-4B872EC73E8F}.Debug|x86.Build.0 = Debug|Any CPU
{687CDF73-8065-4AC8-96C6-4B872EC73E8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{687CDF73-8065-4AC8-96C6-4B872EC73E8F}.Release|Any CPU.Build.0 = Release|Any CPU
{687CDF73-8065-4AC8-96C6-4B872EC73E8F}.Release|x86.ActiveCfg = Release|x86
{687CDF73-8065-4AC8-96C6-4B872EC73E8F}.Release|x86.Build.0 = Release|x86
{687CDF73-8065-4AC8-96C6-4B872EC73E8F}.Release|x86.ActiveCfg = Release|Any CPU
{687CDF73-8065-4AC8-96C6-4B872EC73E8F}.Release|x86.Build.0 = Release|Any CPU
{FEB1A757-C083-4FBE-B052-80356EA1715F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FEB1A757-C083-4FBE-B052-80356EA1715F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FEB1A757-C083-4FBE-B052-80356EA1715F}.Debug|x86.ActiveCfg = Debug|x86
Expand All @@ -52,4 +52,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {126E3C73-611D-4B8A-87E1-BCFC92EE1115}
EndGlobalSection
EndGlobal
47 changes: 13 additions & 34 deletions HubConnectionManager/HubConnectionManager.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR.Client;
using Microsoft.AspNet.SignalR.Client;
using Microsoft.AspNet.SignalR.Client.Transports;
using System;
using System.Threading.Tasks;

namespace HubConnectionManager
{
Expand Down Expand Up @@ -55,13 +55,13 @@ private HubConnectionManager(HubConnection hubConnection)

public static IHubConnectionManager GetHubConnectionManager(string url)
{
IHubConnectionManager connectionManager = new HubConnectionManager(url);
var connectionManager = new HubConnectionManager(url);
return connectionManager;
}

public static IHubConnectionManager GetHubConnectionManager(HubConnection hubConnection)
{
IHubConnectionManager connectionManager = new HubConnectionManager(hubConnection);
var connectionManager = new HubConnectionManager(hubConnection);
return connectionManager;
}

Expand Down Expand Up @@ -103,24 +103,18 @@ public void Stop()

private void OnReceived(string data)
{
if (Received != null)
{
Received(data);
}
Received?.Invoke(data);
}

private async void OnClosed()
{
if (Closed != null)
{
Closed();
}
Closed?.Invoke();
await RetryConnection();
}

private async Task RetryConnection()
{
await TaskEx.Delay(RetryPeriod);
await Task.Delay(RetryPeriod);
try
{
await _hubConnection.Start();
Expand All @@ -133,42 +127,27 @@ private async Task RetryConnection()

private void OnReconnecting()
{
if (Reconnecting != null)
{
Reconnecting();
}
Reconnecting?.Invoke();
}

private void OnReconnected()
{
if (Reconnected != null)
{
Reconnected();
}
Reconnected?.Invoke();
}

private void OnConnectionSlow()
{
if (ConnectionSlow != null)
{
ConnectionSlow();
}
ConnectionSlow?.Invoke();
}

private void OnError(Exception error)
{
if (Error != null)
{
Error(error);
}
Error?.Invoke(error);
}

private void OnStateChanged(StateChange stateChange)
{
if (StateChanged != null)
{
StateChanged(stateChange);
}
StateChanged?.Invoke(stateChange);
}

public void Dispose()
Expand Down
129 changes: 15 additions & 114 deletions HubConnectionManager/HubConnectionManager.csproj
Original file line number Diff line number Diff line change
@@ -1,118 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{687CDF73-8065-4AC8-96C6-4B872EC73E8F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HubConnectionManager</RootNamespace>
<AssemblyName>HubConnectionManager.Lib</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>HubConnectionManager</PackageId>
<Version>2.0.0</Version>
<Authors>Derek Heiser</Authors>
<Company>DerekDoes.Net</Company>
<Product>HubConnectionManager</Product>
<Description>SignalR extension to retry connecting to server on initialization</Description>
<Copyright>Copyright © Derek Heiser 2014</Copyright>
<PackageProjectUrl>https://github.com/killnine/HubConnectionManager</PackageProjectUrl>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.AspNet.SignalR.Client, Version=2.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.AspNet.SignalR.Client.2.1.1\lib\net40\Microsoft.AspNet.SignalR.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.4\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO">
<HintPath>..\packages\Microsoft.Bcl.1.1.9\lib\net40\System.IO.dll</HintPath>
</Reference>
<Reference Include="System.Net" />
<Reference Include="System.Runtime">
<HintPath>..\packages\Microsoft.Bcl.1.1.9\lib\net40\System.Runtime.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks">
<HintPath>..\packages\Microsoft.Bcl.1.1.9\lib\net40\System.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="HubConnectionManager.cs" />
<Compile Include="IHubConnectionManager.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
<PackageReference Include="Microsoft.AspNet.SignalR.Client" Version="2.4.1" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
<Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
</Target>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</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>

</Project>
4 changes: 2 additions & 2 deletions HubConnectionManager/IHubConnectionManager.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR.Client;
using Microsoft.AspNet.SignalR.Client.Transports;
using System;
using System.Threading.Tasks;

namespace HubConnectionManager
{
Expand Down
39 changes: 0 additions & 39 deletions HubConnectionManager/Properties/AssemblyInfo.cs

This file was deleted.

20 changes: 0 additions & 20 deletions HubConnectionManager/app.config

This file was deleted.

9 changes: 0 additions & 9 deletions HubConnectionManager/packages.config

This file was deleted.

16 changes: 4 additions & 12 deletions SignalR.Client/App.config
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.9.0" newVersion="2.6.9.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.9.0" newVersion="2.6.9.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down
Loading