The type or namespace IAppBuilder could not be found(missing using a directive pr an assembly reference)

后端 未结 9 1490
故里飘歌
故里飘歌 2020-12-08 18:33

I am working on an Asp.Net MVC 4 Application in which I am using SignalR 2.0.1 and I Mapped it using Owin Startup class and it worked fine at first.

All of a sudden

9条回答
  •  無奈伤痛
    2020-12-08 18:50

    It's an ordering issue.

    using Microsoft.Owin;
    using Owin;
    

    Leads to Microsoft.Owin to be defined first, then Owin is found under already imported Microsoft namespace. If you mouse over Owin of using Owin you should see it was resolved to Microsoft.Owin again and furthermore IDE will gray out using Owin as redundant unused reference.

    Do:

    using global::Owin;
    

    Which clarifies for the compiler not to look for Owin under already defined namespaces (e.g. Microsoft. namespace).

提交回复
热议问题