Could not find IAppBuilder type or namespace (missing using the pr directive for assembly)

I am working on an Asp.Net MVC 4 application in which I use SignalR 2.0.1, and I matched it using the Owin launch class, and it worked fine at first.

Suddenly, when I tried to rebuild my application, he said that the namespace type IAppbuilder not found.

Below is my launch class

 using Microsoft.Owin; using Owin; using WhiteBoardApp; namespace WhiteBoardApp { public class Startup { public void Configuration(IAppBuilder app) { app.MapSignalR(); } } } 

I also installed the Owin package, and for some reason I could not find the Owin startup class, so I just added the normal class and included all the necessary links. May I find out where I am wrong.

+62
c # asp.net-mvc-4 owin signalr
Feb 12 '14 at 19:44
source share
8 answers

Try using the package management console and run

 Update-Package Owin -Reinstall 
+132
Feb 12 '14 at 21:34
source share

I had a similar problem. But instead, Owin the problem was causing Microsoft.Owin obviously

 Update-Package Owin -Reinstall 

Doesn't work, there was no Update-Package Owin

BUT

 Install-Package Microsoft.Owin 

works great for me, thanks.

+22
12 aug. '14 at 13:44 on
source share

The IAppBuilder interface is in the Owin package. Just add the link to your class file:

using Owin;

And rebuild. Your project will pick it up.

I have no idea why VS did not select this, but it is not. As soon as I added this link to my project, everything fell into place.

+7
Oct 06 '14 at 2:04
source share

I encountered the same problem when creating my project. Here are the steps that helped fix my problem:

  • Go to Solution Explorer and find your project
  • Within the project, expand References ; You should see warnings about the problematic link.
  • Right-click References and open Manage NuGet Packages
  • Find the name of the problematic link, i.e. Microsoft.Owin ; After downloading, it shows that it is already installed (it is installed, but it is not installed correctly. Checking the properties> version in step 2 shows 0.0.0.0 )
  • Check Force uninstall, even if there are dependencies on it
  • Delete
  • Install
  • Create and run a project

Problems

Microsoft.Web.Infrastructure cannot be installed because it already exists in the packages folder. Rollback ...

  • Go to the project folder and find the packages
  • Find the problematic package i.e. Microsoft.Web.Infrastructure
  • Delete folder
  • Resume from step 7

Alternatives

Here are the alternatives I read to fix this problem.

  • Clean and rebuild project / solution
  • Restart Visual Studio
  • Reboot the computer.

Good luck.

+3
Aug 12 '16 at 7:06
source share

For some reason, my Visual Studio 2013 did not understand that link paths exist. A yellow exclamation mark before links was shown for all packages added. I checked .. / packages /, but all the files existed, I also opened the .csproj file, which referenced the correct paths.

Closing and opening the solution caused quite a few errors and could not load the projects included in the solution.

Rebooting Visual Studio 2013 saved the day for some inexplicable reason.

+2
Mar 04 '15 at 10:40
source share

My next one, using the equivalent in F #, presents the IAppBuilder hiding problem. It turns out that the Owin clause was interpreted as an incomplete reference to System.Web.Http.Owin, although the Owin.dll link containing the Owin namespace was a link.

 open System.Net.Http open System.Web.Http open Microsoft.Owin open Owin 

The problem was resolved by reordering the entries as follows:

 open Microsoft.Owin open Owin open System.Net.Http open System.Web.Http 

... this may be a bug inherent in the F # compiler, and name conflicts are better handled in C # and elsewhere.

+1
Jun 29 '14 at 23:59
source share

In my case, I navigated the project folders and the location of the vs solution file (.sln). As soon as I finished adding projects again, there was a package folder at the solution level, and one remained in the project subfolder. Thus, in this project, the links to the folders of the corresponding packages in the .csproj file are corrupted.

Reinstalling or other tips regarding the nuget package manager in this thread have been helpful. I noticed that after I reinstalled several packages, in my diff source code from git the path to the packages folder was changed in the csproj file.

Before

 <HintPath>packages\Microsoft.Owin.4.0.1\lib\net45\Microsoft.Owin.dll</HintPath> 
After

After

 <HintPath>..\packages\Microsoft.Owin.4.0.1\lib\net45\Microsoft.Owin.dll</HintPath> 

So, if you are working with the same problem and you have many nuget packages, it may be easier to close the whole solution, open the csproj file in a text editor such as vscode, and fix relative links using search and replace. Then just save, close, reopen the solution in VS and restore the nuget packages. This should do the trick. (In any case, you must delete the local package folder at the project level so that the project really fails if it does not receive the necessary packages.)

0
Aug 27 '19 at 18:12
source share

http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr

Check that you are using visual studio. You can find the following comment.

Note. If you are using Visual Studio 2012, the SignalR Hub Class (v2) class template will not be available. Instead, you can add a simple class called ChatHub.

Also note. If you are using Visual Studio 2012, the OWIN start class template will not be available. Instead, you can add a simple class called Run.

-one
Jun 10 '16 at 9:24
source share



All Articles