-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove System.Web reference from SignalR.Server
- Created new SignalR.AspNet assembly. - Registered ASP.NET specific abstractions in a PreApplicationStart method. - Created package for SignalR.AspNet - Moved routing to SignalR.AspNet. - Removed RequestContext from PersistentConnectionFactory.
- Loading branch information
Showing
28 changed files
with
230 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,6 @@ public NameValueCollection Cookies | |
{ | ||
get; | ||
private set; | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Web; | ||
using Microsoft.Web.Infrastructure.DynamicModuleHelper; | ||
using SignalR.AspNet; | ||
using SignalR.Hubs; | ||
using SignalR.Infrastructure; | ||
using SignalR.Transports; | ||
|
||
[assembly: PreApplicationStartMethod(typeof(Bootstrapper), "Start")] | ||
|
||
namespace SignalR.AspNet | ||
{ | ||
public static class Bootstrapper | ||
{ | ||
public static void Start() | ||
{ | ||
DynamicModuleUtility.RegisterModule(typeof(HubModule)); | ||
|
||
// Replace defaults with asp.net implementations | ||
var typeResolver = new BuildManagerTypeResolver(); | ||
var hubLocator = new BuildManagerTypeLocator(); | ||
|
||
DependencyResolver.Register(typeof(IHubTypeResolver), () => typeResolver); | ||
DependencyResolver.Register(typeof(IHubLocator), () => hubLocator); | ||
|
||
|
||
TransportManager.InitializeDefaultTransports(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Web.Compilation; | ||
using SignalR.Hubs; | ||
|
||
namespace SignalR.AspNet | ||
{ | ||
public class BuildManagerTypeLocator : IHubLocator | ||
{ | ||
private readonly Lazy<IEnumerable<Type>> _hubs = new Lazy<IEnumerable<Type>>(GetAllHubs); | ||
|
||
public IEnumerable<Type> GetHubs() | ||
{ | ||
return _hubs.Value; | ||
} | ||
|
||
public static IEnumerable<Type> GetAllHubs() | ||
{ | ||
return (from Assembly a in BuildManager.GetReferencedAssemblies() | ||
where !a.GlobalAssemblyCache && !a.IsDynamic | ||
from type in GetTypesSafe(a) | ||
where typeof(IHub).IsAssignableFrom(type) && !type.IsAbstract | ||
select type).ToList(); | ||
} | ||
|
||
private static IEnumerable<Type> GetTypesSafe(Assembly a) | ||
{ | ||
try | ||
{ | ||
return a.GetTypes(); | ||
} | ||
catch | ||
{ | ||
return Enumerable.Empty<Type>(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Web.Compilation; | ||
using SignalR.Hubs; | ||
|
||
namespace SignalR.AspNet | ||
{ | ||
public class BuildManagerTypeResolver : DefaultHubTypeResolver | ||
{ | ||
public override Type ResolveType(string hubName) | ||
{ | ||
return base.ResolveType(hubName) ?? BuildManager.GetType(hubName, throwOnError: false); | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
|
||
[assembly: AssemblyTitle("SignalR.AspNet")] | ||
[assembly: AssemblyDescription("Asp.Net host for SignalR")] | ||
[assembly: AssemblyVersion("0.3.6.0")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0"?> | ||
<package> | ||
<metadata> | ||
<id>$id$</id> | ||
<version>$version$</version> | ||
<authors>$author$</authors> | ||
<licenseUrl>https://github.com/SignalR/SignalR/blob/master/LICENSE.md</licenseUrl> | ||
<projectUrl>https://github.com/SignalR/SignalR</projectUrl> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<description>$description$</description> | ||
<dependencies> | ||
<dependency id="SignalR.Server" version="0.3" /> | ||
</dependencies> | ||
</metadata> | ||
</package> |
2 changes: 1 addition & 1 deletion
2
...lR/Routing/IncomingOnlyRouteConstraint.cs → ...et/Routing/IncomingOnlyRouteConstraint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>8.0.30703</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{0E513AE2-BEA8-40CF-B9F2-102B351F2FB2}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>SignalR.AspNet</RootNamespace> | ||
<AssemblyName>SignalR.AspNet</AssemblyName> | ||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\SignalR\</SolutionDir> | ||
<RestorePackages>true</RestorePackages> | ||
</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> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<Private>True</Private> | ||
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Web" /> | ||
<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="..\Common\CommonAssemblyInfo.cs"> | ||
<Link>Properties\CommonAssemblyInfo.cs</Link> | ||
</Compile> | ||
<Compile Include="..\SignalR\TaskAsyncHelper.cs"> | ||
<Link>Infrastructure\TaskAsyncHelper.cs</Link> | ||
</Compile> | ||
<Compile Include="AspNetRequest.cs" /> | ||
<Compile Include="AspNetResponse.cs" /> | ||
<Compile Include="BuildManagerTypeLocator.cs" /> | ||
<Compile Include="BuildManagerTypeResolver.cs" /> | ||
<Compile Include="HttpTaskAsyncHandler.cs" /> | ||
<Compile Include="HubModule.cs" /> | ||
<Compile Include="Infrastructure\TaskWrapperAsyncResult.cs" /> | ||
<Compile Include="AspNetHost.cs" /> | ||
<Compile Include="Bootstrapper.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="Routing\IncomingOnlyRouteConstraint.cs" /> | ||
<Compile Include="Routing\PersistentRouteHandler.cs" /> | ||
<Compile Include="Routing\RouteExtensions.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\SignalR\SignalR.csproj"> | ||
<Project>{1B9A82C4-BCA1-4834-A33E-226F17BE070B}</Project> | ||
<Name>SignalR</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
<None Include="Properties\SignalR.AspNet.nuspec"> | ||
<SubType>Designer</SubType> | ||
</None> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<Import Project="$(SolutionDir)\.nuget\nuget.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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.