Removing Microsoft ASP.NET SignalR Without Traces
A few days ago, when I wanted to use SignalR in a project, I installed Microsoft.AspNet.SignalR using the Package Manager Console.
Microsoft.AspNet.SignalR installation package
I found another simpler solution to the problem that no longer requires SignalR in the project. I removed the package:
Remove package Microsoft.AspNet.SignalR
After running the command above, I noticed that the package Microsoft.AspNet.SignalR
was removed from the file package.config
.
I assumed that any changes to the package installation were made to the project, it will automatically clean up using the uninstall command.
However, the day after I saw some errors in the console log.
WebSocket connection with 'ws: // localhost: 61135 / signalr / reconnect? transport = webSockets & messageId = d-74CFF57F-B% 2C0% 7CF% 2C0% 7CD% 2C0% 7CG% 2C1 & clientProtocol = 1.5 & connectionToken = moGkKaoibXu6xg4srnQoGTdxp3axLXQ5h5guoaVYP25MgSKutfN8D% 2FyQcJhXamlWjnAhBDIPMjWUEoM9W3% 2BP6SQcoQ98jwuiV7lox% 2BMNfgyx2x0FOlj6% 2BO2PcQ% 2Fl3WgwYsbQd7J% 2FL1XFVe3yOvNuzw% 3D% 3D & connectionData =% 5B% 7B% 22name% 22% 3A% 22notificationhub% 22% 7D% 5D & TID = 4 'failed: Error on WebSocket handshake: Unexpected response code: 502
I felt that even though I don't initialize the hub in JS anymore, the hub initialization code is still working somewhere. I am removing StartUp.cs which I added as part of adding SignalR. Launched the app and found this error in the browser.
Then I researched what was still left in my codebase and found that SignalR leaves behind a lot of dependent packages and code files.
Comparing my package.config file, I have the result of the package package:
+ <package id="Microsoft.AspNet.SignalR.Core" version="2.2.0"
targetFramework="net45" />
+ <package id="Microsoft.AspNet.SignalR.JS" version="2.2.0"
targetFramework="net45" />
+ <package id="Microsoft.AspNet.SignalR.SystemWeb" version="2.2.0"
targetFramework="net45" />
+ <package id="Microsoft.Owin" version="2.1.0" targetFramework="net45" />
+ <package id="Microsoft.Owin.Host.SystemWeb" version="2.1.0" targetFramework="net45" />
+ <package id="Microsoft.Owin.Security" version="2.1.0" targetFramework="net45" />
Question 1
Do I need to manually remove each of these packages manually? Any shortcut?
Question 2
The script folder also had js files even after deleting, I had to manually delete it. Is this really required?
jquery.signalR-2.2.0.js
jquery.signalR-2.2.0.min.js
Is this a problem with the SignalR package, or did I do something wrong to face a wasted time situation?
source to share
You also need to remove the package with dependencies in order to remove the dependencies.
- use VS UI (manage packages in solution or project properties)
-
add
-RemoveDependencies
as described in NuGet Powershell ReferenceUninstall-Package Microsoft.AspNet.SignalR -RemoveDependencies
(To get out of the current state, you can install the package back and uninstall using dependencies).
source to share