0

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?

Andrew Simpson
  • 6,883
  • 11
  • 79
  • 179
  • 1
    Take a look at http://stackoverflow.com/questions/21738034/the-type-or-namespace-iappbuilder-could-not-be-foundmissing-using-a-directive-p . You can also look in your references folder to see what you've got. – RandomUs1r Oct 03 '14 at 21:02

1 Answers1

1

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();
        }
Sven Hohenstein
  • 80,497
  • 17
  • 145
  • 168
I'mAguest
  • 26
  • 1