0
votes

I have a ASP.NET C# application.

I am targetting Framework 4.0.

I have this code:

using Microsoft.Owin;
using Owin;
using MyNameSpace;

[assembly: OwinStartup(typeof(MyNameSpace.Startup))]
namespace MyNameSpace
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            app.MapSignalR();
        }
    }
}

I get this error:

The type or namespace name 'Owin' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

If i try to update using the nuGet package console I get this error message:

Could not install package 'Microsoft.Owin 3.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0',

I have followed the advice to install a specific version of SignalR via the command line:

Install-Package Microsoft.AspNet.SignalR -Version 1.1.3

I am wondering if I can do this using Framework 4.0.

I would love to upgrade to framework 4.5.x but the server is Windows Web Server and will only support VS2010 which is limited to Framework 4.0.

What are my options?

1
Take a look at stackoverflow.com/questions/21738034/… . You can also look in your references folder to see what you've got.RandomUs1r

1 Answers

1
votes

Try to replace your code with these:

public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            app.MapHubs();
        }
    }

add the following on your Global.asax

 protected void Application_Start(object sender, EventArgs e)
        {
          RouteTable.Routes.MapHubs();
        }