"SignalR" Doesn't recognize hub - c#

I added all SignalR component but I still have got some errors about dll recognition.
The type or namespace name 'Hub' could not be found (are you missing a using directive or an assembly reference?)
I added following libraries on NuGet;
Microsoft.ASpNet.SignalR
Microsoft.ASpNet.SignalR.Client
Microsoft.ASpNet.SignalR.Core
Microsoft.ASpNet.SignalR.JS
Microsoft.ASpNet.SignalR.OWin
Microsoft.ASpNet.SignalR.SystemWeb
Microsoft.Owin
Microsoft.Owin.Host.SystemWeb
Microsoft.Owin.Security
I think, I don't need most of them.
namespace GenelProject
{
[HubName("gsChat")]
public class ChatHub : Hub
Why Visual Studio doesn't recognize SignalR hub when I want to use it ?

You only need the Microsoft.AspNet.SignalR.Core package. And make sure you have the namespace Microsoft.AspNet.SignalR imported with a using statement in your file.

please right click on your project and select manage Nuget Packages then in Installed tab find Microsoft.ASPnet.signalR press uninstall. then try installing it again.

Related

How to add new namespace in C#

I am creating MVC project behind I am using C# code. I have
`CloudConfigurationManager`
in using read db value . Its showing red Error . I have searched google I need to add namespace.
using Microsoft.Azure;
I have added that also but again Getting Error Like this
type or namespace 'Azure' does not exist in the namespace 'microsoft' (are you missing an assembly reference?) showing like this how to fix this issue how can I add namespace Azure?
i have Fixed issues select Tools Menu select NuGet package Manger console and select package manger console and install Install-Package Microsoft.WindowsAzure.ConfigurationManager after fixed issues
You need reference to the Microsoft.Azure. Follow below steps to add reference.
In Solution Explorer, right click on project and click add reference.
In the Add Reference dialog box, select the tab indicating the type of component you want to reference.
Select the Microsoft.Azure and then click OK.
EDIT :
Also as per J Steen's comment you can add it using nuget package manager. Use below command in Package Manager Console.
Install-Package Microsoft.WindowsAzure.ConfigurationManager

Tweetinvi namespaces are not recognized although dll's are present

I'm using creating a .Net 4.0 application to post stuff to Twitter using the Tweetinvi API. I can't use packages, so I've downloaded the dll's and added them to my project:
Yet my includes are showing errors:
My error console shows:
Error 423 The type or namespace name 'Core' does not exist in the
namespace 'Tweetinvi' (are you missing an assembly
reference?) {...file...}.cs 10 17 ApiProviders
Can anyone tell me why this happens and how I could fix this?
Tweetinvi requires the Bcl.Async package. You need to add that too.
Check all the dependencies and make shure all are installed.
BUT as already said I highly recommend using NuGet for this. If you are not allowed to use the "public feed" you can download the packages and put them in a local folder and add this folder as a new feed in Visual Studio.
Have you tried downloading the project from the download page?
https://tweetinvi.codeplex.com/downloads/get/852208

'AllowAnonymous' could not be found

Everything worked fine until I installed (Package Manager Console) the postal package, then uninstalled and installed an older version.
Now I get an error where it previously was not.
Error:
The type or namespace name 'AllowAnonymous' could not be found (are you missing a using directive or an assembly reference?)
Who knows how to fix this?
Probably you are missing the reference to System.Web.Http assembly in your project?
So you need to:
Add the reference to System.Web.Http;
Add using System.Web.Http; to your controller;
To add Reference you need to do next steps:
In Solution Explorer, right-click the project node and click Add
Reference.
In the Add Reference dialog box, select the tab Assemblies, and enter System.Web.Http into search on the right side.
Select the component System.Web.Http, and then click OK.
Link:
How to: Add or Remove References By Using the Add Reference Dialog Box
Updated answer for 2021 on .Net 5.0, turns out I was missing this line:
using Microsoft.AspNetCore.Authorization;
I had the same problem. After reinstalling a package, MVC 5 was removed and then MVC 3 was added! The following command fixed the problem:
PM> update-package

The type or namespace name 'Http' does not exist?

I have this portable class library, its settings it Windows Phone 8, Windows Store and .NET 4.5.
I'm trying to add the HttpClient, but after I add it by NuGet its runtime version is v4.0.30319, and when i try to using System.Net.Http it states:
The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?)
The following is added as a reference, and was added by NuGet upon install:
System.Net.Http
System.Net.Http.Extensions
System.Net.Http.Primitives
The class I'm trying to use is HttpClient in my portable class library :-/
This MSDN blog post makes it clear that you need to use this special release of HttpClient.
To use the HttpClient package, right click on your solution, go to the
Manage Nuget Packages dialog, search for Id Microsoft.Net.Http, and
make sure “Include Prerelease” is turned on.
This was released last February, but I haven't seen any updates to indicate that it is now obsolete.
EDIT
Here's the page for the latest version of this package

With ServiceStack 3.9.56 cannot find the namespace ServiceStack.ServiceClient.Web

Using NuGet package manager I added the ServiceStack Clients package to a C# project. I tried to add the namespace reference "using ServiceStack.ServiceClient.Web" to a class but the namespace isn't available. I've removed the ServiceStack packages with NuGet, compiled the project and added them again, but the namespace ServiceStack.ServiceClient.Web isn't found.
I have a separate project which uses ServiceStack 3.9.49 and the exact same NuGet packages [ID: ServiceStack.Text & ServiceStack.Common] and the namespace is available in that version.
As this was a new project, I neglected to change the target framework from the client profile to the full/complete profile. Once I made the change, and compiled the app, the namespace was then available. Thanks.

Categories

Resources