net core 什么时候支持asp.net signalrr

asp.net mvc 4 - SignalR 2.0 error /signalr/hubs 404 (Not Found) when using IIS - Stack Overflow
to customize your list.
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
J it only takes a minute:
Join the Stack Overflow community to:
Ask programming questions
Answer and help your peers
Get recognized for your expertise
I'm having some issues with SignalR 2.0 in EPiServer 7.5 (a MVC4 framework). All I get is a 404 error
404 (Not Found)
I'm hosting everything on a Windows 2012 R2 Server. Also noteworthy is that the solution works when running everything in IIS Express from Visual Studio but not in IIS 8.5.
What I've done so far is to add the SingalR references.
Microsoft.AspNet.SignalR.Client, 2.0.0.0
Microsoft.AspNet.SignalR.Core, 2.0.0.0
Microsoft.AspNet.SignalR.System.Web, 2.0.0.0
Microsoft.OWin, 2.1.0.0
Microsoft.OWin.Host.SystemWeb, 2.1.0.0
Microsoft.Owin.Security, 2.0.0.0
Owin, 1.0.0.0
Startup.cs
The startup is intitialized on application start so that seems
[assembly: OwinStartup(typeof(Web.Startup))]
namespace Web
public class Startup
#region Local variables
private static readonly ILog Logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion
#region Methods
/// &summary&
/// Configure SignalR
/// &/summary&
/// &param name="app"&&/param&
public void Configuration(IAppBuilder app)
Logger.MethodCallEntry();
// Any connection or hub wire up and configuration should go here
//app.MapSignalR(); // Doesn't work either
var hubConfiguration = new HubConfiguration
EnableDetailedErrors = true,
EnableJavaScriptProxies = false
app.MapSignalR("/signalr", hubConfiguration);
catch (Exception ex)
Logger.Error("Failed to initialize or map SignalR", ex);
Logger.MethodCallExit();
#endregion
Script inclusion
&script src="/Static/Frameworks/Scripts/jquery-1.10.2.js"&&/script&
&script src="/Static/Frameworks/Scripts/knockout-3.0.0.js"&&/script&
&script src="/Static/Frameworks/Scripts/modernizr.2.7.0.js"&&/script&
&script src="/Static/Frameworks/Scripts/jquery.signalR-2.0.1.js"&&/script&
&!-- also tried path ~/signalr/hubs --&
&script src="/signalr/hubs"&&/script&
This is not a solution updated from 1.x SignalR!
9,9441566113
just wanted to put my 2 cents in.
I had this error, and it ended up being because i had
&add key="owin:AutomaticAppStartup" value="false" /&
in my web.config.
removing this line fixed everything up for me!
The error was the exact same as in this post
The solution was to totally empty the asp.net cache
Run this in PowerShell
net stop w3svc
Remove-Item -Path "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\*" -Force -Recurse
Remove-Item -Path "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\*" -Force -Recurse
net start w3svc
9,9441566113
I just had a similar problem getting the "MoveShape" demo to work on a freshly built Win 2012R2 server.
I resolved the problem by adding the role/features: "Web Server (IIS)" -> "Application Development" and selecting ".NET Extensibility 4.5", "ASP.NET 4.5", "ISAPI Extensions", "ISAPI Filters" and "WebSocket Protocol".
Once I restarted the system or IIS, the demo starting working.
My problem was resolved by removing nuget-package "Microsoft.Owin.Host.SystemWeb", which was referenced in packages.config with version="2.1.0" and installing version="3.0.1".
With this version the owin environment was never started on the iis8 on server 2012r2 with the error, that the namespace "Host" was not found.
<mon.CurrentVersion.targets(1697,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Owin.Host.SystemWeb, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf, processorArchitecture=MSIL". Check to make sure the assembly exists on disk.
Startup.cs(2,22): error CS0234: The type or namespace name 'Host' does not exist in the namespace 'Microsoft.Owin' (are you missing an assembly reference?) [*.csproj]
Just had the same 404 problem. Ended up I updated all the DLLs except for one which was problem. I didn't update Microsoft.AspNet.SignalR.SystemWeb.dll
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you&#39;re looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled初识ASP.NET Core 1.0
标签:博客园每日微软技术系列&nbsp&nbsp 作者:richiezhang
时间:&nbsp&nbsp 浏览次数:
本文将对微软下一代ASP.NET框架做个概括性介绍,方便大家进一步熟悉该框架。
在介绍ASP.NET Core 1.0之前有必要澄清一些产品名称及版本号。ASP.NET Core1.0是微软下一代ASP.NET 框架,在这之前ASP.NET版本稳定在ASP.NET& 4.6,对应的.NET Framework版本为.net 4.6.2。
曾经一段时间微软将下一代ASP.NET 命名为ASP.NET 5和MVC 6,在一文中,微软第一次提到ASP.NET 5将会改为ASP.NET Core1.0。
该文还指出了.NET其他产品命名变化
ASP.NET 5 现在叫做 ASP.NET Core 1.0
.NET Core 现在叫做 .NET Core 1.0
Entity Framework 7 现在叫做 Entity Framework Core 1.0 或者简称 EF Core 1.0
之所以有这样的改变,微软解释为:下一代的ASP.NET并不是ASP.NET 4.6的简单升级,如果命名为ASP.NET 5则会给开发者一个错误的暗示,开发者会误认为这只是功能上的升级。而事实是微软首先写了一个轻量级跨平台的.NET Core,然后在该平台下重新设计了ASP.NET,新一代的ASP.NET Core 1.0有着众多新的特性,当然最重要的是实现了跨平台。
值得注意的是从ASP.NET 5到ASP.NET Core 1.0这一命名的转变会对开发人员造成一些困惑,因为在一些ASP.NET相关的网站中,仍然可以不时地看到Asp.net 5 或者MVC 6等名称。事实上,由于ASP.NET Core 1.0正式版还没有发布,命名的改变还在进行当中,整个命名的改变过程到ASP.NET Core1.0正式发布之后才会全部结束。于此同时也产生了一些新的概念:DNX:.NET Execution Environment,即.NET运行时环境,在Windows,Mac和Linux下运行.NET应用程序的环境(有点目前windows环境下的.NET Framework的意思),当然这东西是跨平台的,这是跟.NET Framework最大的不同之处。DNVM:NX Version Manager,即DNX的版本管理工具,利用DNVM可以管理DNX的不同版本,你可以轻松切换到不同的DNX版本中。.NET Core:可以理解为一个经过精简的、模块化的.NET Framework子集,目的是为了跨平台。.NET Core有一系列的类库组成,叫做"CoreFX",一个更精简的版本叫做"CoreCLR"。
整个.NET Core所有类库包括之前提到的ASP.NET Core都是通过Nuget来管理的。
一、安装ASP.NET Core 1.0
这一过程在Windows、Mac和Linux下各不相同,微软给出了,以Windows为例又分为两种方式,。
二、新建ASP.NET Core项目
安装完毕后,VS2015会增加对应的模板,值得注意的是该模板目前仍旧叫做ASP.NET 5。
三、项目结构
1、project.json文件:
dependencies节点:用来管理Nuget依赖,支持智能提示,这一过程等价于在Nuget package Manager中管理依赖项。
commands节点:在DNX环境下可以使用命令来执行一组命令,对于:
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel",
"ef": "mands"
可以这样使用:
//这一命令将会启动KestrelHttp 服务器,KestrelHttpServer是微软基于libuv编写的跨平台web 服务器
2、frameworks节点:该节点定义了DNX环境
"frameworks": {
"dnx451": { },
"dnxcore50": { }
dnx451表示.NET Framework 4.5.1,dnxcore50表示.NET Core5。
该节点表明此程序可以跑在这两种DNX环境中,在代码中还可以通过下面的方式针对具体的环境编写代码。
#if DNX451
// utilize resource only available with .NET Framework
四、ASP.NET Core1.0带来的新特性
1、采用新的文件系统,不再通过工程文件(.sln和.csproj)来定义项目文件清单。
以本Demo为例,所有添加在AspnetCore.Practice文件夹下的文件都会被自动添加在项目中,举个例子:打开AspnetCore.Practice\Controllers文件夹:在文件夹内手工添加一个文件ServiceController.cs,并添加如下测试代码:
using System.Collections.G
using System.L
using System.Threading.T
using Microsoft.AspNet.M
namespace AspnetCore.Practice.Controllers
public class ServiceController : Controller
public IActionResult Index()
return Content("hello world");
注意,此时打开VS的项目管理器,可以看到ServiceController已经添加到了项目中。这时若在浏览器中直接输入测试代码的url,即可看到测试结果。也就是说VS在后台监视到了新文件便会自动添加在项目中并自动完成编译。
2、Startup类。
该类可以看作整个ASP.NET Core的启动入口,该类主要存在3个方法:Main函数是入口点,方法ConfigureServices用来向IOC容器中注册组建,方法Configure则用来注册Middleware。
也许你第一次见到这个类会有点不明觉厉,该类中3个方法既没有接口约束,也没有从父类继承。微软在该处采用了这样一种约定:必须要存在一个名叫Startup的类,同时该类必须要存在上面提到的3个方法,该ASP.NET项目才能顺利运行成功。
采用约定而非契约编程的原因在于约定更加灵活。特别是在方法Configure()签名中,参数可以从容器中注入,意味着你可以定义这样的Configure方法:
public void Configure(IApplicationBuilder app, IHostingEnvironment env,
ILoggerFactory loggerFactory)
也可以定义这样的Configure方法:
public void Configure(IApplicationBuilder app, IHostingEnvironment env,
ILoggerFactory loggerFactory,IUserProvider userProvider)
要保证这样的灵活性对于契约编程很难做到。
即便你对约定这一事实一无所知,一些异常信息也会帮助你朝着正确的方向编写代码。比如当你将Startup类重命名为其他,例如命名为Bootstrapper,你将会得到如下的提示:
同样的道理,如果方法ConfigureServices或Configure漏写也会得到相似的提示。
该类除了采用约定,大部分代码都是在接口上实现扩展方法的风格,想进一步了解这种代码风格请阅读《》。
3、读取Appsetting
由于已经不再存在web.config文件,所以新的Appsetting也采取了更加通用的设计。在新建项目的时候VS已经帮我们添加了默认的appsettings.json文件。
定义一个键值对:"hello": "Hello, world",同时在Startup类的构造函数中将appsettings.json文件添加到了ConfigurationBuilder对象中:
public Startup(IHostingEnvironment env)
// Set up configuration sources.
var builder = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
Configuration = builder.Build();
同时我们还可以看到一个环境变量env.EnvironmentName,这个设计也有利于我们区分QA,INT,UAT,Production等不同的运行环境。这一变量可以在项目配置中设置:
在代码中可以通过Configuration["hello"]的方式读取我们之前定义的Appsettings。
3、默认自带IOC容器,统一依赖注入API
依赖注入技术从很大程度上使得代码更加模块化,会在一定程度上迫使你写出低耦合,SRP的代码,另外有着良好设计的代码也具备更好的可测试性。
ASP.NET Core自己内置了一个非常轻量级的IOC容器,例如以下代码将组建IEmailSender和ISmsSender分别注册在了容器中。
public void ConfigureServices(IServiceCollection services)
// Add application services.
services.AddTransient&IEmailSender, AuthMessageSender&();
services.AddTransient&ISmsSender, AuthMessageSender&();
当然你可以引入第三方比较成熟的IOC容器,项目定义了一组抽象,只需要将具体的IOC容器实现该抽象即可整合进ASP.NET Core中。就目前的情况来看ASP.NET Core内置的容器比较适合ASP.NET Core内部的组建使用,而实际业务依赖则可以使用第三方更强大的容器来注册。
另外在ASP.NET Core新的设计中,不光Controller可以进行依赖注入,Filter,View以及ViewModel都可进行注入。这方面的内容比较多,也许会在单独的文章中进行介绍。
4、Middleware
这一设计借鉴自 项目的管道设计。什么是Middleware?下面这幅图很好的描述了Middleware是如何在http请求过程中工作的。
在方法Configure中调用的内容都可以理解为Middleware:
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
app.UseIISPlatformHandler(); //Middleware
app.UseStaticFiles(); //Middleware
app.UseMvc(routes =&
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
//Middleware
注册一个Middleware有两种写法,比如你自定义了一个CustomerMiddleware,
第一种注册方法:
app.UseMiddleware&CustomerMiddleware&();
第二种则更常用:首先写一个扩展方法
public static class MiddlewareExtensions
public static IApplicationBuilder UseCustomerMiddleware(this IApplicationBuilder builder)
return builder.UseMiddleware&CustomerMiddleware&();
然后就可以这样使用了:app.UseCustomerMiddleware();
自定义Middleware请关注后续文章。
5、统一MVC和WebAPI
ASP.NET Core统一了MVC和WebAPI,这表现在这两者共用同一套代码,并且在开发过程中不用再继承各自独立的Controller基类了。下面展示了如何在同一个Controller中编写MVC和WebAPI:
public class ServiceController : Controller
private readonly IConfigurationRoot _configurationR
public ServiceController(IConfigurationRoot configurationRoot)
_configurationRoot = configurationR
public IActionResult Index()
return Content("hello world");
public User GetUser()
var user = _configurationRoot.Get&User&("Users");// 读取appsettings.json中的对象
这一示例采用了构造器注入,为了让IOC容器注入IConfigurationRoot参数,我们需要将该实例注册进IOC容器中:
public void ConfigureServices(IServiceCollection services)
services.AddInstance(Configuration);
6、Razor页面中引入新的Tag Helpers
在之前的Razor页面中,我们可以利用HtmlHelper扩展来完成数据绑定和页面展示,例如:
@Html.EditorFor (i =& i.Email, new {htmlAttributes = new {@class = "form-control"}})
ASP.NET Core设计了新的方案:
&input asp-for="Email" class="form-control" /&
这种写法更加接近HTML,对纯前段人员更加友好,也更利于结合一些前端的MVVM框架来使用。当然我们还可以根据自己的需求编写。使用Tag Helpers需要添加如下Nuget package:
"dependencies": {
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final"}
另外一个例子对比:
HtmlHelpers:
@using (Html.BeginForm( "Register", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { role = "form" }))
@Html.AntiForgeryToken()
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
TagHelpers:
&form class="form-horizontal" method="post" role="form" asp-controller="Account" asp-action="Register"&
&div class="text-danger" asp-validation-summary="ValidationSummary.All"&&/div&
&!-- other tags or tag helpers --&
7、其他一些特性如View Components,Caching&
本文介绍了下一代的ASP.NET版本ASP.NET Core 1.0并且对其新的特性做了概括性的介绍,有助于.NET开发者对ASP.NET Core有一个全面的认识,随着我对ASP.NET Core的进一步了解还会对一些细节进行更进一步的补充,欢迎大家关注。
相关阅读:
热门推荐文章其实这是个有奖活动贴。n其实这是个有奖活动贴。n其实这是个有奖活动贴。
马来西亚很有想法,值得我们仔细推敲······这背后一定很有文章可做!
就在上个月,美国得州帕克县发生了一起越狱
昨天,马云在杭州办了一场世界级的公益大会,听说全世界爱管“闲事”的公益达人都被请来了。其实马云自己就是个爱管
想成为大树,就不要和草去比短期来看,草的生长速度和树相比,肯定是草的长势明显,但是几年过后,草换了几拨,但是
德国抗洪神器被吹捧上天?这里真相了!
俄罗斯人严重的中国人民解放军真给力!
她高冷,她美艳,她霸气,她高贵,她总是自带光环的出现在各大秀场,让我们想不去瞩目都不行。她就是游天翼,一位长
宠物帮每日首发全球最新宠物故事,关注宠物帮就够了
本周行情很重要,释放得这三大技术信号值得我们关注!================================================
北京佳音知识产权服务有限公司 专业办理全国各省市地区如下业务:,,,软件著作权加急,,
&软件版权登记,软件版权申请,软件版权代理,软件版权加急,计算机软件版权
软著申请找佳音 省时省事又放心
委托佳音 静候佳音
佳音给您带来佳音
软件著作权在线
【百度/360/搜狗
软件著作权代理 自然排名全部第一喔】
================================================
在计算机科学里面有两件非常艰难的事情:缓存失效和命名 - Phil Karlton
  ASP.NET 在过去的 15 年里是个非常不错的&品牌&。 ASP.NET 4.6 已经支持在生产环境使用:http://get.asp.net。
  但是,命名是新的,完全截取自 ASP.NET 框架 && "ASP.NET 5",但这并不是个好主意,其中一个原因是:5 & 4.6,这样看起来 ASP.NET 5 比 ASP.NET 4.6 版本号更大,更好,甚至是可以替代 ASP.NET 4.6。
  所以修改了名字,选择了一个更好的版本号。
  重新引入 ASP.NET Core 1.0 和 .NET Core 1.0
ASP.NET 5 现在是 ASP.NET Core 1.0.
.NET Core 5 现在是 .NET Core 1.0.
Entity Framework 7 现在是 Entity Framework Core 1.0 或者 EF Core 1.0
  为什么是 1.0?因为他们全都是全新的。.NET Core 概念是新的,&.NET Core 1.0 CLI&也是新的。不仅如此,.NET Core 不是完整的 .NET Framework 4.6。.NET 团队还在研究服务端图像库,也正在研究 ASP.NET 4.6 和 ASP.NET Core 1.0 之间的不同。
  那么如何选择?
  非常明确的是,ASP.NET 4.6 是个更成熟的平台,经过了很好的测试。 ASP.NET Core 1.0 是 1.0 版本,包括 Web API 和 MVC,但是不包括 SignalR 或者 Web Pages。ASP.NET Core 1.0 不支持 VB 或者 F#。
  ASP.NET Core 1.0 并不是结束,仅仅是个全新的开始, ASP.NET 4.6 还会继续更新,继续提供完整的支持。
专业软件著作权代理服务
软件著作权在线 全国客户服务热线:400 001 9768
本网站已经在工业和信息化部备案
Copyright 2016 & 北京佳音知识产权服务有限公司
地址:北京市朝阳区望京中环南路甲2号四层B6127}

我要回帖

更多关于 asp.net signalr 下载 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信