I am trying to implement Azure Redis Cache in my existing ASP.NET Web Application.
Its build in .NET Framework 4.5
Compatible Option of StackExchange.Redis nuget package is 1.2.6
When i install and use the same, it gives error: "Not able to Connect"
Just by changing my application to build in .NET Framework 4.6 and not even updating StackExchange.Redis to latest compatible version, my code start working.
I cannot change .NET Framework of my Web application.
Please help.
Is here anyone who have faced this issue?
You can see my demo first. I can use StackExchange.Redis 1.2.6 in .NET Framework 4.5 project. You can download my demo for test, you just need to paste your connectionstr. If no ssl, you also need to change port to 6379.
My CacheConnection like below. No SSL cert.
<add key="CacheConnection" value="pans******he.redis.cache.windows.net:6379,password=*********,ssl=False,abortConnect=False,allowAdmin=true"/>
Why add ,allowAdmin=true, becase below code.
var server = Connection.GetServer(endpoint.Host, endpoint.Port);
var clients = server.ClientList();
Related
I am planning to use Enterprise Library for database access on a Web API project which is going to be built using .Net core app.
But I am unable to install Enterprise library using NuGet as the latest version of Enterprise Library is not compatible with.Net core app framework.
Note, I don't want to use Entity Framework.
Appreciate if the community can help on this.
If you can migrate your application to .Net Core 2.0 which is still in preview mode, but Microsoft promised to release it by Q3 2017, I have forked out the Enterprise Library project and ported that to .Net Core 2.0 which you can find it under this repository:
https://github.com/Chavoshi/EnterpriseLibrary.NetCore
And also this is the Nuget package for Data Application Block:
https://www.nuget.org/packages/EnterpriseLibrary.Data.NetCore
Still there are some missing parts such as OdbcFactory and OleDbFactory which they are not available in .Net ported APIs (Or Nuget package is not published yet), but I am keep working on them to maybe port them by myself or update it since the API will be available. I appreciate anyone who can contribute on this project as well. :)
Is it possible to use ASP.NET Web API 2 with .net 4.0? I tried to upgrade from an older version but I get:
Could not install package 'Microsoft.AspNet.WebApi.Client 5.0.0'. You
are trying to install this package into a project that targets
'.NETFramework,Version=v4.0'
To answer my own question:
No, it is NOT possible to use Web API 2 with .net 4.0:
This is taken from a slide by Damian Edwards. You can find additinal info here.
FWIW, I had a .NET 4.0 requirement on the client (die WinXP!), but I could do .NET 4.5 on the server. So, I have WebApi2 running server side, but the WebApi1 client package running on the client, handling serialization, etc.
Using the Package Manager Console in Visual Studio and choosing my client project in the default project dropdown, I was able to:
Install-Package Microsoft.AspNet.WebApi.Client -Version 4.0.30506.0
Everything thereafter worked well.
I installed the SignalR package when our project was running .net 4.0. We since upgraded to 4.5 and I want to support WebSockets. I uninstalled Signal packages and reinstalled SignalR (per this answer). However the SignalR DLL versions (1.1.0/1.1.3) are identical in both cases.
Here is my configuration:
ASP.NET 4.5
IIS 8.0 (Windows Server 2012)
WebSockets feature enabled on the server
A WebSocket supporting browser (latest version of Firefox)
Even though I have all these required things, I still get this:
{"Url":"/signalr","ConnectionToken":"Yy6qHcSMMm4vPl9i3ungxJ5aa2P0SJh4UoU4pelAyFcMud0596UaeB6x8AmhZ2SxW_MPk23QXrKGkwar7LjLLnWlBZx1nokd6LRe96k8D-Oua3kSnKsyDa1RrPTE0n9FyaUO9rK3caLfue20Dmx5UkB9F2TKusPD4PDqQw2","ConnectionId":"b7b00e98-3128-4fbb-ba63-fb16f922f168","KeepAliveTimeout":20.0,"DisconnectTimeout":30.0,"TryWebSockets":false,"WebSocketServerUrl":null,"ProtocolVersion":"1.2"}
I guess the important parts are:
"TryWebSockets":false,"WebSocketServerUrl":null,"ProtocolVersion":"1.2"
Does this mean that I am not using WebSockets? What could I be missing?
Thanks so much.
WebSockets are supported in all major versions of SignalR.
Therefore the question is "what is required for my SignalR application to use WebSockets?"
ASP.NET 4.5
IIS 8.0 (Windows Server 2012 or Windows 8)
WebSockets feature enabled on the server
A WebSocket supporting browser
Now that we've established what is required to have a WebSocket enabled application it seems that your missing the enabling of the WebSockets feature.
To enable WebSockets on your server follow the "Step by Step instructions" here.
Hope this helps!
I know your problem - the same that hit ours!
Your problem is the client you are running from.
The client Windows stack must be > Windows7 to use WebSockets on a
.Net Client
This caught us too!
Browsers aren't affected as they have their own WebSocket stack, but the Windows .Net networking stack doesn't have WebSockets.
Windows 8/Windows 2012 and IIS 8 fixes that.
This is why the SignalR load tester (crank) can't use WebSockets when run on Windows7, only in Windows 2012 (regardless of server)
We since upgraded to 4.5 and I want to support WebSockets.
I'm running Windows 2012 Server, IIS 8, WebSockets feature installed on server and I still get this
Since you are using ASP.NET 4.5, IIS 8 and Windows Server 2012, the problem should be relying on how you migrated the project to .NET framework 4.5 or with the browser. Given that most of the modern web browsers support web sockets, I highly doubt your references are still for the .NET framework 4.0.
Try by creating a new project using .NET framework as 4.5. Simply setting the target using project properties sometimes doesn't update the assemblies.
I am using SignalR 0.5.3, installed via NuGet, for my .NET 4.5 Web Application - now, since I need to push data from SQL SERVER 2008R2 (supporting only the .NET Framework up to 3.5), I need to create a library using the SignalR .NET 3.5 Client.
I have seen in the project website that there is probably a SignalR.Client.NET35 version but (being not very familiar neither with github nor with NuGet) I have no clue how to install that client for the library project I have to work on.
I have tried installing with the std command install-package SignalR.Client but the message i get is:
Install-Package : Could not install package 'SignalR.Client 0.5.3'.
You are trying to install this package into a project that targets
'.NETFramework,Version=v3.5', but the package does not contain any assembly
references that are compatible with that framework.
For more information, contact the package author.
so it looks like the right .NET version is not picked correctly/out of the box.
Before bothering the author, i thought to give a try round here.
Any suggestions?
We haven't packaged the 3.5 client into the package as yet. You'll need to build from source.
I backported the v1.x and v2.x SignalR clients to NET 3.5. Available as NuGet packages here: http://www.nuget.org/packages/Nivot.SignalR.Client.Net35/
This question is related to this: Problem with bin Deploying ASP.NET MVC 3 I erase the line with targetFramework="4.0" but now I have another problem. It says:
Could not load file or assembly 'EntityFramework' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
I can´t get access to IIS server because it is from provider of my hosting. It´s weird because one of my website is running on this server (MVC3 too) and now I am trying add next and it is not working. Thanks for every help.
Have you made sure your provider has .NET 4.0 installed on their server?
It sounds like you are trying to run a .NET 4.0 application on a server that only has .NET 3.5 installed