Ver código fonte

Clearify dynamic port forwarding.

drieseng 9 anos atrás
pai
commit
6c29387d5f
35 arquivos alterados com 716 adições e 79 exclusões
  1. 8 0
      src/App2/App.xaml
  2. 106 0
      src/App2/App.xaml.cs
  3. 143 0
      src/App2/App2.csproj
  4. BIN
      src/App2/App2_TemporaryKey.pfx
  5. 3 0
      src/App2/ApplicationInsights.config
  6. BIN
      src/App2/Assets/LockScreenLogo.scale-200.png
  7. BIN
      src/App2/Assets/SplashScreen.scale-200.png
  8. BIN
      src/App2/Assets/Square150x150Logo.scale-200.png
  9. BIN
      src/App2/Assets/Square44x44Logo.scale-200.png
  10. BIN
      src/App2/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
  11. BIN
      src/App2/Assets/StoreLogo.png
  12. BIN
      src/App2/Assets/Wide310x150Logo.scale-200.png
  13. 13 0
      src/App2/MainPage.xaml
  14. 30 0
      src/App2/MainPage.xaml.cs
  15. 49 0
      src/App2/Package.appxmanifest
  16. 29 0
      src/App2/Properties/AssemblyInfo.cs
  17. 31 0
      src/App2/Properties/Default.rd.xml
  18. 16 0
      src/App2/project.json
  19. 20 0
      src/ConsoleApp1/ConsoleApp1.xproj
  20. 14 0
      src/ConsoleApp1/Program.cs
  21. 23 0
      src/ConsoleApp1/Properties/AssemblyInfo.cs
  22. 32 0
      src/ConsoleApp1/project.json
  23. 2 2
      src/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj
  24. 2 2
      src/Renci.SshNet.Silverlight5/Renci.SshNet.Silverlight5.csproj
  25. 8 8
      src/Renci.SshNet.UAP10/Renci.SshNet.UAP10.csproj
  26. 52 0
      src/Renci.SshNet.VS2015.sln
  27. 3 3
      src/Renci.SshNet.WindowsPhone8/Renci.SshNet.WindowsPhone8.csproj
  28. 8 4
      src/Renci.SshNet/Abstractions/DnsAbstraction.cs
  29. 6 4
      src/Renci.SshNet/Abstractions/ThreadAbstraction.cs
  30. 7 5
      src/Renci.SshNet/Common/SshDataStream.cs
  31. 2 1
      src/Renci.SshNet/ForwardedPortDynamic.cs
  32. 2 2
      src/Renci.SshNet/Renci.SshNet.csproj
  33. 4 2
      src/Renci.SshNet/Security/Cryptography/HashAlgorithmFactory.cs
  34. 98 42
      src/Renci.SshNet/Session.NET.cs
  35. 5 4
      src/Renci.SshNet/Shell.cs

+ 8 - 0
src/App2/App.xaml

@@ -0,0 +1,8 @@
+<Application
+    x:Class="App2.App"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:local="using:App2"
+    RequestedTheme="Light">
+
+</Application>

+ 106 - 0
src/App2/App.xaml.cs

@@ -0,0 +1,106 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.ApplicationModel;
+using Windows.ApplicationModel.Activation;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+namespace App2
+{
+    /// <summary>
+    /// Provides application-specific behavior to supplement the default Application class.
+    /// </summary>
+    sealed partial class App : Application
+    {
+        /// <summary>
+        /// Initializes the singleton application object.  This is the first line of authored code
+        /// executed, and as such is the logical equivalent of main() or WinMain().
+        /// </summary>
+        public App()
+        {
+            this.InitializeComponent();
+            this.Suspending += OnSuspending;
+        }
+
+        /// <summary>
+        /// Invoked when the application is launched normally by the end user.  Other entry points
+        /// will be used such as when the application is launched to open a specific file.
+        /// </summary>
+        /// <param name="e">Details about the launch request and process.</param>
+        protected override void OnLaunched(LaunchActivatedEventArgs e)
+        {
+#if DEBUG
+            if (System.Diagnostics.Debugger.IsAttached)
+            {
+                this.DebugSettings.EnableFrameRateCounter = true;
+            }
+#endif
+            Frame rootFrame = Window.Current.Content as Frame;
+
+            // Do not repeat app initialization when the Window already has content,
+            // just ensure that the window is active
+            if (rootFrame == null)
+            {
+                // Create a Frame to act as the navigation context and navigate to the first page
+                rootFrame = new Frame();
+
+                rootFrame.NavigationFailed += OnNavigationFailed;
+
+                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
+                {
+                    //TODO: Load state from previously suspended application
+                }
+
+                // Place the frame in the current Window
+                Window.Current.Content = rootFrame;
+            }
+
+            if (e.PrelaunchActivated == false)
+            {
+                if (rootFrame.Content == null)
+                {
+                    // When the navigation stack isn't restored navigate to the first page,
+                    // configuring the new page by passing required information as a navigation
+                    // parameter
+                    rootFrame.Navigate(typeof(MainPage), e.Arguments);
+                }
+                // Ensure the current window is active
+                Window.Current.Activate();
+            }
+        }
+
+        /// <summary>
+        /// Invoked when Navigation to a certain page fails
+        /// </summary>
+        /// <param name="sender">The Frame which failed navigation</param>
+        /// <param name="e">Details about the navigation failure</param>
+        void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
+        {
+            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
+        }
+
+        /// <summary>
+        /// Invoked when application execution is being suspended.  Application state is saved
+        /// without knowing whether the application will be terminated or resumed with the contents
+        /// of memory still intact.
+        /// </summary>
+        /// <param name="sender">The source of the suspend request.</param>
+        /// <param name="e">Details about the suspend request.</param>
+        private void OnSuspending(object sender, SuspendingEventArgs e)
+        {
+            var deferral = e.SuspendingOperation.GetDeferral();
+            //TODO: Save application state and stop any background activity
+            deferral.Complete();
+        }
+    }
+}

+ 143 - 0
src/App2/App2.csproj

@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.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')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProjectGuid>{33B54E09-865F-4717-8DC0-61284391DA56}</ProjectGuid>
+    <OutputType>AppContainerExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>App2</RootNamespace>
+    <AssemblyName>App2</AssemblyName>
+    <DefaultLanguage>en-US</DefaultLanguage>
+    <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
+    <TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
+    <TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
+    <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <PackageCertificateKeyFile>App2_TemporaryKey.pfx</PackageCertificateKeyFile>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+    <NoWarn>;2008</NoWarn>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <ErrorReport>prompt</ErrorReport>
+    <Prefer32Bit>true</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+    <Optimize>true</Optimize>
+    <NoWarn>;2008</NoWarn>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <ErrorReport>prompt</ErrorReport>
+    <Prefer32Bit>true</Prefer32Bit>
+    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\ARM\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+    <NoWarn>;2008</NoWarn>
+    <DebugType>full</DebugType>
+    <PlatformTarget>ARM</PlatformTarget>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <ErrorReport>prompt</ErrorReport>
+    <Prefer32Bit>true</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
+    <OutputPath>bin\ARM\Release\</OutputPath>
+    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+    <Optimize>true</Optimize>
+    <NoWarn>;2008</NoWarn>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>ARM</PlatformTarget>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <ErrorReport>prompt</ErrorReport>
+    <Prefer32Bit>true</Prefer32Bit>
+    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+    <NoWarn>;2008</NoWarn>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <ErrorReport>prompt</ErrorReport>
+    <Prefer32Bit>true</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+    <Optimize>true</Optimize>
+    <NoWarn>;2008</NoWarn>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <ErrorReport>prompt</ErrorReport>
+    <Prefer32Bit>true</Prefer32Bit>
+    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
+  </PropertyGroup>
+  <ItemGroup>
+    <!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
+    <Content Include="ApplicationInsights.config">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <None Include="project.json" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="App.xaml.cs">
+      <DependentUpon>App.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="MainPage.xaml.cs">
+      <DependentUpon>MainPage.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <AppxManifest Include="Package.appxmanifest">
+      <SubType>Designer</SubType>
+    </AppxManifest>
+    <None Include="App2_TemporaryKey.pfx" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Properties\Default.rd.xml" />
+    <Content Include="Assets\LockScreenLogo.scale-200.png" />
+    <Content Include="Assets\SplashScreen.scale-200.png" />
+    <Content Include="Assets\Square150x150Logo.scale-200.png" />
+    <Content Include="Assets\Square44x44Logo.scale-200.png" />
+    <Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
+    <Content Include="Assets\StoreLogo.png" />
+    <Content Include="Assets\Wide310x150Logo.scale-200.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <ApplicationDefinition Include="App.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </ApplicationDefinition>
+    <Page Include="MainPage.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+  </ItemGroup>
+  <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
+    <VisualStudioVersion>14.0</VisualStudioVersion>
+  </PropertyGroup>
+  <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.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>
+  -->
+</Project>

BIN
src/App2/App2_TemporaryKey.pfx


+ 3 - 0
src/App2/ApplicationInsights.config

@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ApplicationInsights xmlns = "http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
+</ApplicationInsights>

BIN
src/App2/Assets/LockScreenLogo.scale-200.png


BIN
src/App2/Assets/SplashScreen.scale-200.png


BIN
src/App2/Assets/Square150x150Logo.scale-200.png


BIN
src/App2/Assets/Square44x44Logo.scale-200.png


BIN
src/App2/Assets/Square44x44Logo.targetsize-24_altform-unplated.png


BIN
src/App2/Assets/StoreLogo.png


BIN
src/App2/Assets/Wide310x150Logo.scale-200.png


+ 13 - 0
src/App2/MainPage.xaml

@@ -0,0 +1,13 @@
+<Page
+    x:Class="App2.MainPage"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:local="using:App2"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    mc:Ignorable="d">
+
+    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
+
+    </Grid>
+</Page>

+ 30 - 0
src/App2/MainPage.xaml.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
+
+namespace App2
+{
+    /// <summary>
+    /// An empty page that can be used on its own or navigated to within a Frame.
+    /// </summary>
+    public sealed partial class MainPage : Page
+    {
+        public MainPage()
+        {
+            this.InitializeComponent();
+        }
+    }
+}

+ 49 - 0
src/App2/Package.appxmanifest

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<Package
+  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
+  xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
+  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
+  IgnorableNamespaces="uap mp">
+
+  <Identity
+    Name="3371af4c-bc30-40ea-ac93-975660d7f0a1"
+    Publisher="CN=Gert"
+    Version="1.0.0.0" />
+
+  <mp:PhoneIdentity PhoneProductId="3371af4c-bc30-40ea-ac93-975660d7f0a1" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
+
+  <Properties>
+    <DisplayName>App2</DisplayName>
+    <PublisherDisplayName>Gert</PublisherDisplayName>
+    <Logo>Assets\StoreLogo.png</Logo>
+  </Properties>
+
+  <Dependencies>
+    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
+  </Dependencies>
+
+  <Resources>
+    <Resource Language="x-generate"/>
+  </Resources>
+
+  <Applications>
+    <Application Id="App"
+      Executable="$targetnametoken$.exe"
+      EntryPoint="App2.App">
+      <uap:VisualElements
+        DisplayName="App2"
+        Square150x150Logo="Assets\Square150x150Logo.png"
+        Square44x44Logo="Assets\Square44x44Logo.png"
+        Description="App2"
+        BackgroundColor="transparent">
+        <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
+        <uap:SplashScreen Image="Assets\SplashScreen.png" />
+      </uap:VisualElements>
+    </Application>
+  </Applications>
+
+  <Capabilities>
+    <Capability Name="internetClient" />
+  </Capabilities>
+</Package>

+ 29 - 0
src/App2/Properties/AssemblyInfo.cs

@@ -0,0 +1,29 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("App2")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("App2")]
+[assembly: AssemblyCopyright("Copyright ©  2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// 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.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: ComVisible(false)]

+ 31 - 0
src/App2/Properties/Default.rd.xml

@@ -0,0 +1,31 @@
+<!--
+    This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
+    developers. However, you can modify these parameters to modify the behavior of the .NET Native
+    optimizer.
+
+    Runtime Directives are documented at http://go.microsoft.com/fwlink/?LinkID=391919
+
+    To fully enable reflection for App1.MyClass and all of its public/private members
+    <Type Name="App1.MyClass" Dynamic="Required All"/>
+
+    To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
+    <TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
+
+    Using the Namespace directive to apply reflection policy to all the types in a particular namespace
+    <Namespace Name="DataClasses.ViewModels" Seralize="All" />
+-->
+
+<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
+  <Application>
+    <!--
+      An Assembly element with Name="*Application*" applies to all assemblies in
+      the application package. The asterisks are not wildcards.
+    -->
+    <Assembly Name="*Application*" Dynamic="Required All" />
+    
+    
+    <!-- Add your application specific runtime directives here. -->
+
+
+  </Application>
+</Directives>

+ 16 - 0
src/App2/project.json

@@ -0,0 +1,16 @@
+{
+  "dependencies": {
+    "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.0-rc3-23931-00"
+  },
+  "frameworks": {
+    "uap10.0": {}
+  },
+  "runtimes": {
+    "win10-arm": {},
+    "win10-arm-aot": {},
+    "win10-x86": {},
+    "win10-x86-aot": {},
+    "win10-x64": {},
+    "win10-x64-aot": {}
+  }
+}

+ 20 - 0
src/ConsoleApp1/ConsoleApp1.xproj

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
+    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+  </PropertyGroup>
+
+  <Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>93879798-7d2b-4550-8412-d492ee7172a8</ProjectGuid>
+    <RootNamespace>ConsoleApp1</RootNamespace>
+    <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
+    <OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+  </PropertyGroup>
+  <Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
+</Project>

+ 14 - 0
src/ConsoleApp1/Program.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace ConsoleApp1
+{
+    public class Program
+    {
+        public static void Main(string[] args)
+        {
+        }
+    }
+}

+ 23 - 0
src/ConsoleApp1/Properties/AssemblyInfo.cs

@@ -0,0 +1,23 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ConsoleApp1")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("ConsoleApp1")]
+[assembly: AssemblyCopyright("Copyright ©  2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("93879798-7d2b-4550-8412-d492ee7172a8")]

+ 32 - 0
src/ConsoleApp1/project.json

@@ -0,0 +1,32 @@
+{
+  "version": "1.0.0-*",
+  "description": "ConsoleApp1 Console Application",
+  "authors": [ "Gert" ],
+  "tags": [ "" ],
+  "projectUrl": "",
+  "licenseUrl": "",
+
+  "compilationOptions": {
+    "emitEntryPoint": true
+  },
+
+  "dependencies": {
+  },
+
+  "commands": {
+    "ConsoleApp1": "ConsoleApp1"
+  },
+
+  "frameworks": {
+    "dnx451": { },
+    "dnxcore50": {
+      "dependencies": {
+        "Microsoft.CSharp": "4.0.1-beta-23516",
+        "System.Collections": "4.0.11-beta-23516",
+        "System.Console": "4.0.0-beta-23516",
+        "System.Linq": "4.0.1-beta-23516",
+        "System.Threading": "4.0.11-beta-23516"
+      }
+    }
+  }
+}

+ 2 - 2
src/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj

@@ -18,7 +18,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_HASH_MD5;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HASH_SHA384;FEATURE_HASH_SHA512;FEATURE_HASH_RIPEMD160;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160;FEATURE_THREAD_SLEEP;FEATURE_MEMORYSTREAM_GETBUFFER</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_RNG_CSP;FEATURE_SOCKET_EAP;FEATURE_STREAM_APM;FEATURE_DNS_SYNC;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_HASH_MD5;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HASH_SHA384;FEATURE_HASH_SHA512;FEATURE_HASH_RIPEMD160;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160;FEATURE_MEMORYSTREAM_GETBUFFER</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
@@ -26,7 +26,7 @@
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE;TUNING;FEATURE_HASH_MD5;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HASH_SHA384;FEATURE_HASH_SHA512;FEATURE_HASH_RIPEMD160;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160</DefineConstants>
+    <DefineConstants>TRACE;TUNING;FEATURE_RNG_CSP;FEATURE_SOCKET_EAP;FEATURE_STREAM_APM;FEATURE_DNS_SYNC;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_HASH_MD5;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HASH_SHA384;FEATURE_HASH_SHA512;FEATURE_HASH_RIPEMD160;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160;FEATURE_MEMORYSTREAM_GETBUFFER</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>bin\Release\Renci.SshNet.xml</DocumentationFile>

+ 2 - 2
src/Renci.SshNet.Silverlight5/Renci.SshNet.Silverlight5.csproj

@@ -29,7 +29,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>Bin\Debug</OutputPath>
-    <DefineConstants>TRACE;DEBUG;SILVERLIGHT;TUNING;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_RNG_CRYPTO;FEATURE_THREAD_SLEEP;FEATURE_MEMORYSTREAM_GETBUFFER</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;SILVERLIGHT;TUNING;FEATURE_RNG_CSP;FEATURE_SOCKET_EAP;FEATURE_DNS_SYNC;FEATURE_STREAM_APM;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_MEMORYSTREAM_GETBUFFER;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;</DefineConstants>
     <NoStdLib>true</NoStdLib>
     <NoConfig>true</NoConfig>
     <ErrorReport>prompt</ErrorReport>
@@ -41,7 +41,7 @@
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>Bin\Release</OutputPath>
-    <DefineConstants>TRACE;SILVERLIGHT;TUNING;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256</DefineConstants>
+    <DefineConstants>TRACE;SILVERLIGHT;TUNING;FEATURE_RNG_CSP;FEATURE_SOCKET_EAP;FEATURE_DNS_SYNC;FEATURE_STREAM_APM;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_MEMORYSTREAM_GETBUFFER;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;</DefineConstants>
     <NoStdLib>true</NoStdLib>
     <NoConfig>true</NoConfig>
     <ErrorReport>prompt</ErrorReport>

+ 8 - 8
src/Renci.SshNet.UAP10/Renci.SshNet.UAP10.csproj

@@ -23,7 +23,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_STREAM_ASYNC_TPL;FEATURE_SOCKET_EAP;FEATURE_DNS_ASYNC;FEATURE_TPL;FEATURE_SOCKET_TAP;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_TAP;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_HASH_MD5;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
@@ -32,7 +32,7 @@
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+    <DefineConstants>TRACE;TUNING;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_TAP;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_HASH_MD5;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
@@ -40,7 +40,7 @@
     <PlatformTarget>x86</PlatformTarget>
     <DebugSymbols>true</DebugSymbols>
     <OutputPath>bin\x86\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_STREAM_ASYNC_TPL;FEATURE_SOCKET_EAP</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_TAP;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_HASH_MD5;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
     <NoWarn>;2008</NoWarn>
     <DebugType>full</DebugType>
     <PlatformTarget>AnyCPU</PlatformTarget>
@@ -50,7 +50,7 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
     <PlatformTarget>x86</PlatformTarget>
     <OutputPath>bin\x86\Release\</OutputPath>
-    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+    <DefineConstants>TRACE;TUNING;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_TAP;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_HASH_MD5;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
     <Optimize>true</Optimize>
     <NoWarn>;2008</NoWarn>
     <DebugType>pdbonly</DebugType>
@@ -62,7 +62,7 @@
     <PlatformTarget>ARM</PlatformTarget>
     <DebugSymbols>true</DebugSymbols>
     <OutputPath>bin\ARM\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_STREAM_ASYNC_TPL;FEATURE_SOCKET_EAP;FEATURE_SOCKET_TAP;FEATURE_TPL;FEATURE_DNS_ASYNC;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_TAP;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_HASH_MD5;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
     <NoWarn>;2008</NoWarn>
     <DebugType>full</DebugType>
     <PlatformTarget>ARM</PlatformTarget>
@@ -72,7 +72,7 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
     <PlatformTarget>ARM</PlatformTarget>
     <OutputPath>bin\ARM\Release\</OutputPath>
-    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+    <DefineConstants>TRACE;TUNING;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_TAP;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_HASH_MD5;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
     <Optimize>true</Optimize>
     <NoWarn>;2008</NoWarn>
     <DebugType>pdbonly</DebugType>
@@ -84,7 +84,7 @@
     <PlatformTarget>x64</PlatformTarget>
     <DebugSymbols>true</DebugSymbols>
     <OutputPath>bin\x64\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_STREAM_ASYNC_TPL;FEATURE_SOCKET_EAP</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_TAP;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_HASH_MD5;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
     <NoWarn>;2008</NoWarn>
     <DebugType>full</DebugType>
     <PlatformTarget>x64</PlatformTarget>
@@ -94,7 +94,7 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
     <PlatformTarget>x64</PlatformTarget>
     <OutputPath>bin\x64\Release\</OutputPath>
-    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+    <DefineConstants>TRACE;TUNING;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_TAP;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_HASH_MD5;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
     <Optimize>true</Optimize>
     <NoWarn>;2008</NoWarn>
     <DebugType>pdbonly</DebugType>

+ 52 - 0
src/Renci.SshNet.VS2015.sln

@@ -53,6 +53,10 @@ Project("{911E67C6-3D85-4FCE-B560-20A9C3E3FF48}") = "nuget", "Build\nuget\nuget.
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Renci.SshNet.UAP10", "Renci.SshNet.UAP10\Renci.SshNet.UAP10.csproj", "{EC212E04-A372-4B95-B45B-C0D4A739EF80}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App2", "App2\App2.csproj", "{33B54E09-865F-4717-8DC0-61284391DA56}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.xproj", "{93879798-7D2B-4550-8412-D492EE7172A8}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -181,6 +185,54 @@ Global
 		{EC212E04-A372-4B95-B45B-C0D4A739EF80}.Release|x64.Build.0 = Release|x64
 		{EC212E04-A372-4B95-B45B-C0D4A739EF80}.Release|x86.ActiveCfg = Release|x86
 		{EC212E04-A372-4B95-B45B-C0D4A739EF80}.Release|x86.Build.0 = Release|x86
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|Any CPU.ActiveCfg = Debug|ARM
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|Any CPU.Build.0 = Debug|ARM
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|Any CPU.Deploy.0 = Debug|ARM
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|ARM.ActiveCfg = Debug|ARM
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|ARM.Build.0 = Debug|ARM
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|ARM.Deploy.0 = Debug|ARM
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|Mixed Platforms.Build.0 = Debug|x86
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|Mixed Platforms.Deploy.0 = Debug|x86
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|x64.ActiveCfg = Debug|x64
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|x64.Build.0 = Debug|x64
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|x64.Deploy.0 = Debug|x64
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|x86.ActiveCfg = Debug|x86
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|x86.Build.0 = Debug|x86
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|x86.Deploy.0 = Debug|x86
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|Any CPU.ActiveCfg = Release|x86
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|ARM.ActiveCfg = Release|ARM
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|ARM.Build.0 = Release|ARM
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|ARM.Deploy.0 = Release|ARM
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|Mixed Platforms.Build.0 = Release|x86
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|Mixed Platforms.Deploy.0 = Release|x86
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|x64.ActiveCfg = Release|x64
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|x64.Build.0 = Release|x64
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|x64.Deploy.0 = Release|x64
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|x86.ActiveCfg = Release|x86
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|x86.Build.0 = Release|x86
+		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|x86.Deploy.0 = Release|x86
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|ARM.ActiveCfg = Debug|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|ARM.Build.0 = Debug|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|x64.Build.0 = Debug|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|x86.Build.0 = Debug|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|Any CPU.Build.0 = Release|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|ARM.ActiveCfg = Release|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|ARM.Build.0 = Release|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|x64.ActiveCfg = Release|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|x64.Build.0 = Release|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|x86.ActiveCfg = Release|Any CPU
+		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 3 - 3
src/Renci.SshNet.WindowsPhone8/Renci.SshNet.WindowsPhone8.csproj

@@ -23,7 +23,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>Bin\Debug</OutputPath>
-    <DefineConstants>TRACE;DEBUG;SILVERLIGHT;WINDOWS_PHONE;TUNING;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_RNG_CRYPTO;FEATURE_THREAD_SLEEP;FEATURE_MEMORYSTREAM_GETBUFFER</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;SILVERLIGHT;WINDOWS_PHONE;TUNING;FEATURE_RNG_CSP;FEATURE_SOCKET_EAP;FEATURE_DNS_SYNC;FEATURE_STREAM_APM;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_MEMORYSTREAM_GETBUFFER;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;</DefineConstants>
     <NoStdLib>true</NoStdLib>
     <NoConfig>true</NoConfig>
     <ErrorReport>prompt</ErrorReport>
@@ -35,7 +35,7 @@
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>Bin\Release</OutputPath>
-    <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE;TUNING;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256</DefineConstants>
+    <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE;TUNING;FEATURE_RNG_CSP;FEATURE_SOCKET_EAP;FEATURE_DNS_SYNC;FEATURE_STREAM_APM;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_MEMORYSTREAM_GETBUFFER;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;</DefineConstants>
     <NoStdLib>true</NoStdLib>
     <NoConfig>true</NoConfig>
     <ErrorReport>prompt</ErrorReport>
@@ -924,7 +924,7 @@
   <Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
   <ProjectExtensions>
     <VisualStudio>
-      <UserProperties ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" />
+      <UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" />
     </VisualStudio>
   </ProjectExtensions>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 

+ 8 - 4
src/Renci.SshNet/Abstractions/DnsAbstraction.cs

@@ -14,10 +14,12 @@ namespace Renci.SshNet.Abstractions
         /// </returns>
         public static IPAddress[] GetHostAddresses(string hostNameOrAddress)
         {
-#if FEATURE_DNS_ASYNC
+#if FEATURE_DNS_SYNC
+            return Dns.GetHostAddresses(hostNameOrAddress);
+#elif FEATURE_DNS_TAP
             return Dns.GetHostAddressesAsync(hostNameOrAddress).Result;
 #else
-            return Dns.GetHostAddresses(hostNameOrAddress);
+            #error Retrieving IP addresses for a given host is not implemented.
 #endif
         }
 
@@ -31,10 +33,12 @@ namespace Renci.SshNet.Abstractions
         /// </returns>
         public static IPHostEntry GetHostEntry(string hostNameOrAddress)
         {
-#if FEATURE_DNS_ASYNC
+#if FEATURE_DNS_SYNC
+            return Dns.GetHostEntry(hostNameOrAddress);
+#elif FEATURE_DNS_TAP
             return Dns.GetHostEntryAsync(hostNameOrAddress).Result;
 #else
-            return Dns.GetHostEntry(hostNameOrAddress);
+            #error Resolving host name or IP address to an IPHostEntry is not implemented.
 #endif
         }
     }

+ 6 - 4
src/Renci.SshNet/Abstractions/ThreadAbstraction.cs

@@ -12,10 +12,10 @@ namespace Renci.SshNet.Abstractions
         {
 #if FEATURE_THREAD_SLEEP
             System.Threading.Thread.Sleep(millisecondsTimeout);
-#elif FEATURE_TPL
+#elif FEATURE_THREAD_TAP
             System.Threading.Tasks.Task.Delay(millisecondsTimeout).Wait();
 #else
-#error Suspend of the current thread is not implemented.
+            #error Suspend of the current thread is not implemented.
 #endif
         }
 
@@ -25,10 +25,12 @@ namespace Renci.SshNet.Abstractions
         /// <param name="action">The action to execute.</param>
         public static void ExecuteThread(Action action)
         {
-#if FEATURE_TPL
+#if FEATURE_THREAD_THREADPOOL
+            System.Threading.ThreadPool.QueueUserWorkItem(o => action());
+#elif FEATURE_THREAD_TAP
             System.Threading.Tasks.Task.Run(action);
 #else
-            System.Threading.ThreadPool.QueueUserWorkItem(o => action());
+            #error Execution of action in a separate thread is not implemented.
 #endif
         }
     }

+ 7 - 5
src/Renci.SshNet/Common/SshDataStream.cs

@@ -202,7 +202,7 @@ namespace Renci.SshNet.Common
         private byte[] ReadBytes(int length)
         {
             var data = new byte[length];
-            var bytesRead = base.Read(data, 0, length);
+            var bytesRead = Read(data, 0, length);
 
             if (bytesRead < length)
                 throw new ArgumentOutOfRangeException("length");
@@ -214,17 +214,19 @@ namespace Renci.SshNet.Common
         /// Writes the stream contents to a byte array, regardless of the <see cref="MemoryStream.Position"/>.
         /// </summary>
         /// <returns>
-        /// This method returns a copy of the contents of the <see cref="SshDataStream"/> as a byte array.
-        /// If the current instance was constructed on a provided byte array, a copy of the section of the array to which this instance has access is returned.
-        /// TODO
+        /// This method returns the contents of the <see cref="SshDataStream"/> as a byte array.
         /// </returns>
+        /// <remarks>
+        /// If the current instance was constructed on a provided byte array, a copy of the section of the array
+        /// to which this instance has access is returned.
+        /// </remarks>
         public override byte[] ToArray()
         {
             if (Capacity == Length)
             {
 #if FEATURE_MEMORYSTREAM_GETBUFFER
                 return GetBuffer();
-#else
+#elif FEATURE_MEMORYSTREAM_TRYGETBUFFER
                 ArraySegment<byte> buffer;
                 if (TryGetBuffer(out buffer))
                     return buffer.Array;

+ 2 - 1
src/Renci.SshNet/ForwardedPortDynamic.cs

@@ -4,7 +4,8 @@ using System.Threading;
 namespace Renci.SshNet
 {
     /// <summary>
-    /// Provides functionality for dynamic port forwarding
+    /// Provides functionality for forwarding connections from the client to destination servers via the SSH server,
+    /// also known as dynamic port forwarding.
     /// </summary>
     public partial class ForwardedPortDynamic : ForwardedPort
     {

+ 2 - 2
src/Renci.SshNet/Renci.SshNet.csproj

@@ -18,7 +18,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_HASH_MD5;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HASH_SHA384;FEATURE_HASH_SHA512;FEATURE_HASH_RIPEMD160;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160;FEATURE_MEMORYSTREAM_GETBUFFER;FEATURE_THREAD_SLEEP</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_RNG_CSP;FEATURE_SOCKET_EAP;FEATURE_STREAM_APM;FEATURE_DNS_SYNC;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_HASH_MD5;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HASH_SHA384;FEATURE_HASH_SHA512;FEATURE_HASH_RIPEMD160;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160;FEATURE_MEMORYSTREAM_GETBUFFER</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>bin\Debug\Renci.SshNet.xml</DocumentationFile>
@@ -27,7 +27,7 @@
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TUNING;FEATURE_HASH_MD5;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HASH_SHA384;FEATURE_HASH_SHA512;FEATURE_HASH_RIPEMD160;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160</DefineConstants>
+    <DefineConstants>TUNING;FEATURE_RNG_CSP;FEATURE_SOCKET_EAP;FEATURE_STREAM_APM;FEATURE_DNS_SYNC;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_HASH_MD5;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HASH_SHA384;FEATURE_HASH_SHA512;FEATURE_HASH_RIPEMD160;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160;FEATURE_MEMORYSTREAM_GETBUFFER</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>bin\Release\Renci.SshNet.xml</DocumentationFile>

+ 4 - 2
src/Renci.SshNet/Security/Cryptography/HashAlgorithmFactory.cs

@@ -6,10 +6,12 @@ namespace Renci.SshNet.Security.Cryptography
     {
         public static RandomNumberGenerator CreateRandomNumberGenerator()
         {
-#if FEATURE_RNG_CRYPTO
+#if FEATURE_RNG_CREATE
+            return RandomNumberGenerator.Create();
+#elif FEATURE_RNG_CSP
             return new RNGCryptoServiceProvider();
 #else
-            return RandomNumberGenerator.Create();
+            #error Creation of RandomNumberGenerator is not implemented.
 #endif
         }
 

+ 98 - 42
src/Renci.SshNet/Session.NET.cs

@@ -7,6 +7,7 @@ using Renci.SshNet.Common;
 using Renci.SshNet.Messages.Transport;
 using System.Diagnostics;
 using System.Collections.Generic;
+using System.Threading;
 using Renci.SshNet.Abstractions;
 
 namespace Renci.SshNet
@@ -114,17 +115,39 @@ namespace Renci.SshNet
             Log(string.Format("Initiating connect to '{0}:{1}'.", ConnectionInfo.Host, ConnectionInfo.Port));
 
 #if FEATURE_SOCKET_EAP
-            if (!_socket.ConnectAsync(ep).Wait(timeout))
-                throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
-                    "Connection failed to establish within {0:F0} milliseconds.", timeout.TotalMilliseconds));
-#else
+            var connectCompleted = new ManualResetEvent(false);
+            var connectAsyncEventArgs = new SocketAsyncEventArgs
+                {
+                    RemoteEndPoint = ep,
+                };
+            connectAsyncEventArgs.Completed += (sender, args) => { connectCompleted.Set(); };
+
+            if (_socket.ConnectAsync(connectAsyncEventArgs))
+            {
+                if (!connectCompleted.WaitOne(timeout, false))
+                    throw new SshOperationTimeoutException(
+                        string.Format(
+                            CultureInfo.InvariantCulture,
+                            "Connection failed to establish within {0:F0} milliseconds.",
+                            timeout.TotalMilliseconds));
+            }
+
+            if (connectAsyncEventArgs.SocketError != SocketError.Success)
+                throw new SocketException((int) connectAsyncEventArgs.SocketError);
+#elif FEATURE_SOCKET_APM
             var connectResult = _socket.BeginConnect(ep, null, null);
             if (!connectResult.AsyncWaitHandle.WaitOne(timeout, false))
                 throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
                     "Connection failed to establish within {0:F0} milliseconds.", timeout.TotalMilliseconds));
 
             _socket.EndConnect(connectResult);
-#endif // FEATURE_SOCKET_ASYNC_TPL
+#elif FEATURE_SOCKET_TAP
+            if (!_socket.ConnectAsync(ep).Wait(timeout))
+                throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
+                    "Connection failed to establish within {0:F0} milliseconds.", timeout.TotalMilliseconds));
+#else
+            #error Connecting socket is not implemented.
+#endif
         }
 
         /// <summary>
@@ -133,6 +156,7 @@ namespace Renci.SshNet
         /// <exception cref="SocketException">An error occurred when trying to access the socket.</exception>
         partial void SocketDisconnect()
         {
+            // TODO should disconnect instead ?!!
             _socket.Dispose();
         }
 
@@ -148,47 +172,79 @@ namespace Renci.SshNet
             var buffer = new List<byte>();
             var data = new byte[1];
 
-            // read data one byte at a time to find end of line and leave any unhandled information in the buffer
-            // to be processed by subsequent invocations
-            do
-            {
-#if FEATURE_SOCKET_TAP
-                var receiveTask = _socket.ReceiveAsync(new ArraySegment<byte>(data, 0, data.Length), SocketFlags.None);
-                if (!receiveTask.Wait(timeout))
-                    throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
-                        "Socket read operation has timed out after {0:F0} milliseconds.", timeout.TotalMilliseconds));
-
-                var received = receiveTask.Result;
-#else
-                var asyncResult = _socket.BeginReceive(data, 0, data.Length, SocketFlags.None, null, null);
-                if (!asyncResult.AsyncWaitHandle.WaitOne(timeout))
-                    throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
-                        "Socket read operation has timed out after {0:F0} milliseconds.", timeout.TotalMilliseconds));
+#if FEATURE_SOCKET_EAP
+            var receiveCompleted = new AutoResetEvent(false);
+            var receiveAsyncEventArgs = new SocketAsyncEventArgs { SocketFlags = SocketFlags.None };
+            receiveAsyncEventArgs.Completed += (sender, args) => receiveCompleted.Set();
+            receiveAsyncEventArgs.SetBuffer(data, 0, data.Length);
 
-                var received = _socket.EndReceive(asyncResult);
-#endif // FEATURE_SOCKET_TAP
+#endif // FEATURE_SOCKET_EAP
 
-                if (received == 0)
-                    // the remote server shut down the socket
-                    break;
+            try
+            {
+                // read data one byte at a time to find end of line and leave any unhandled information in the buffer
+                // to be processed by subsequent invocations
+                do
+                {
+#if FEATURE_SOCKET_EAP
+                    if (_socket.ReceiveAsync(receiveAsyncEventArgs))
+                    {
+                        if (!receiveCompleted.WaitOne(timeout))
+                            throw new SshOperationTimeoutException(
+                                string.Format(
+                                    CultureInfo.InvariantCulture,
+                                    "Socket read operation has timed out after {0:F0} milliseconds.",
+                                    timeout.TotalMilliseconds));
+                    }
 
-                buffer.Add(data[0]);
+                    var received = receiveAsyncEventArgs.BytesTransferred;
+#elif FEATURE_SOCKET_TAP
+                    var receiveTask = _socket.ReceiveAsync(new ArraySegment<byte>(data, 0, data.Length), SocketFlags.None);
+                    if (!receiveTask.Wait(timeout))
+                        throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
+                            "Socket read operation has timed out after {0:F0} milliseconds.", timeout.TotalMilliseconds));
+
+                    var received = receiveTask.Result;
+    #elif FEATURE_SOCKET_APM
+                    var asyncResult = _socket.BeginReceive(data, 0, data.Length, SocketFlags.None, null, null);
+                    if (!asyncResult.AsyncWaitHandle.WaitOne(timeout))
+                        throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
+                            "Socket read operation has timed out after {0:F0} milliseconds.", timeout.TotalMilliseconds));
+
+                    var received = _socket.EndReceive(asyncResult);
+    #else
+                    #error Receiving from socket is not implemented.
+    #endif
+
+                    if (received == 0)
+                        // the remote server shut down the socket
+                        break;
+
+                    buffer.Add(data[0]);
+                }
+                while (!(buffer.Count > 0 && (buffer[buffer.Count - 1] == LineFeed || buffer[buffer.Count - 1] == Null)));
+
+                if (buffer.Count == 0)
+                    response = null;
+                else if (buffer.Count == 1 && buffer[buffer.Count - 1] == 0x00)
+                    // return an empty version string if the buffer consists of only a 0x00 character
+                    response = string.Empty;
+                else if (buffer.Count > 1 && buffer[buffer.Count - 2] == CarriageReturn)
+                    // strip trailing CRLF
+                    response = SshData.Ascii.GetString(buffer.Take(buffer.Count - 2).ToArray());
+                else if (buffer.Count > 1 && buffer[buffer.Count - 1] == LineFeed)
+                    // strip trailing LF
+                    response = SshData.Ascii.GetString(buffer.Take(buffer.Count - 1).ToArray());
+                else
+                    response = SshData.Ascii.GetString(buffer.ToArray());
+            }
+            finally
+            {
+#if FEATURE_SOCKET_EAP
+                receiveAsyncEventArgs.Dispose();
+                receiveCompleted.Dispose();
+#endif // FEATURE_SOCKET_EAP
             }
-            while (!(buffer.Count > 0 && (buffer[buffer.Count - 1] == LineFeed || buffer[buffer.Count - 1] == Null)));
-
-            if (buffer.Count == 0)
-                response = null;
-            else if (buffer.Count == 1 && buffer[buffer.Count - 1] == 0x00)
-                // return an empty version string if the buffer consists of only a 0x00 character
-                response = string.Empty;
-            else if (buffer.Count > 1 && buffer[buffer.Count - 2] == CarriageReturn)
-                // strip trailing CRLF
-                response = SshData.Ascii.GetString(buffer.Take(buffer.Count - 2).ToArray());
-            else if (buffer.Count > 1 && buffer[buffer.Count - 1] == LineFeed)
-                // strip trailing LF
-                response = SshData.Ascii.GetString(buffer.Take(buffer.Count - 1).ToArray());
-            else
-                response = SshData.Ascii.GetString(buffer.ToArray());
         }
 
         /// <summary>

+ 5 - 4
src/Renci.SshNet/Shell.cs

@@ -142,7 +142,7 @@ namespace Renci.SshNet
 
                     while (_channel.IsOpen)
                     {
-#if FEATURE_STREAM_ASYNC_TPL
+#if FEATURE_STREAM_TAP
                         var readTask = _input.ReadAsync(buffer, 0, buffer.Length);
                         var readWaitHandle = ((IAsyncResult) readTask).AsyncWaitHandle;
 
@@ -156,8 +156,7 @@ namespace Renci.SshNet
 #endif
                             continue;
                         }
-
-#else
+#elif FEATURE_STREAM_APM
                         var asyncResult = _input.BeginRead(buffer, 0, buffer.Length, delegate(IAsyncResult result)
                         {
                             //  If input stream is closed and disposed already dont finish reading the stream
@@ -180,7 +179,9 @@ namespace Renci.SshNet
 
                         if (asyncResult.IsCompleted)
                             continue;
-#endif // FEATURE_STREAM_ASYNC_TPL
+#else
+#error Async receive is not implemented.
+#endif
                         break;
                     }
                 }