NuGet Unable to load the service index for source Authentication failed - visual-studio

Since today for some reason I'm unable to connect to the NuGet package manager through Visual Studio.
[nuget.org] Unable to load the service index for source https://api.nuget.org/v3/index.json.
An error occurred while sending the request.
The underlying connection was closed: An unexpected error occurred on a send.
Authentication failed because the remote party has closed the transport stream.
But I cannot get it to work again...
Things I tried.
Delete NuGet.config
Clear NuGet cache
Disable TLS1.0 and TLS1.1 explicitly
Enabled TLS1.2 explicitly
followed the manual from nuget at https://devblogs.microsoft.com/nuget/deprecating-tls-1-0-and-1-1-on-nuget-org/
Different Visual Studios
Update to the latest Visual Studio 2019
Tried different TLS settings in the RegEdit for 1.0, 1.1 and 1.2. I don't have a TLS1.3 section yet.
I can browse to https://api.nuget.org/v3/index.json with chrome
TLS1.2 Client settings:
TLS1.2 Server settings:
Specs:
Windows Server 2012R2, Visual Studio 2019
Also tried it on a different Windows Server 2012R2 machine and same problem
It is still working on my laptop with Windows 10.
Hopefully someone has an idea.
Thanks

I had the same problem.
The solution was to install the microsoft/artifacts-credprovider as mentioned here
Invoke-Expression "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx"

Had exactly the same problem, running script from https://github.com/microsoft/azure-devops-tls12 and following instructions from it helped me.
In my case it generated additional script file, after running that and restaring pc nuget was working once again.

Related

Visual Studio 2019 Installation Issue

I'm trying to install Visual Studio 2019 Community Edition on Windows 10.
I have downloaded the web installer from the official site. Once I click on the installer, I get stuck on this screen, which says 'Downloading: 0B of 0B'
Stuck on this screen
I checked the installation log, which shows below message.
"VisualStudio Bootstrapper:02/12/2020 2:50:48 PM: WebClient failed in 'https://aka.ms/vs/16/release/installer' with 'The operation has timed out' - 'https://aka.ms/vs/16/release/installer'.
VisualStudio Bootstrapper:02/12/2020 2:50:48 PM: WebClient failed attempting to access https://aka.ms/vs/16/release/installer via 23.13.51.44
VisualStudio Bootstrapper:02/12/2020 2:50:48 PM: Download failed using WebClient engine. System.Net.WebException: The operation has timed out"
I tried accessing the URL 'https://aka.ms/vs/16/release/installer' from Google Chrome, and the file got downloaded.
However, when I tried to browser the same URL through Internet Explorer 11, I realized that there is a redirect to 'https://download.visualstudio.microsoft.com/download/pr/9d2147aa-7b01-4336-b665-8fe07735e5ee/D6E0778F57A0F56302E6AD5B55B0423E148CCE2244A5D6047C3256E841052A23/vs_installer.opc'
The redirected URL is accessible through Google Chrome (It downloads Visual Studio Installer), but I just getting loading screen in IE, and I cannot open Developers Tools to check what the problem is.
IE Screen
I'm assuming Web Installer is following IE's process, and hence cannot download the necessary files.
How do I move ahead from here?
I have had the same problem. I solved it by restoring default setting of windows brandmauer and turning on windows defender.
According to the log you posted,
WebClient failed attempting to access https://aka.ms/vs/16/release/installer via 23.13.51.44
Download failed using WebClient engine. System.Net.WebException: The operation has timed out"
Please check there have 3rd party anti-virus software enabled or enterprise group policy in place that might block the download. And temporarily disabling Windows Defender and\or Windows Defender Controlled Folder Access.
If you install Visual Studio behind a firewall or proxy server, then there are domain URLs that you can add to an “allow list” so that you have the best experience when you install and use Visual Studio.
Please refer to this document about more details: https://learn.microsoft.com/en-us/visualstudio/install/install-and-use-visual-studio-behind-a-firewall-or-proxy-server?view=vs-2019#install-visual-studio

IIS Express Remote access with Visual Studio 2019

I don't remeber this being an issue before, and many threads are rather outdated now.
On my Windows 10 installation VS 2019 hosts my project at http://localhost:58402 just fine.
However when I go to change the url under Properties > Debug > App URL to 0.0.0.0:58402 I get the error:
Cannot connect to web server IIS Express
What I have tried:
Running VS 2019 as admin
Restarting computer
Deleting hidden VS folder
Modifying launchSettings.json in my API project properties folder
I can change the port just fine. But as soon as I change localhost to 0.0.0.0 the error occurs.
Update:
I have been using the NPM package iisexpress-proxy with great success now as a daily driver for 5 months now.
Had some difficulty with CORS, but disabling that for local debugging allows me to do everything I would expect.
https://www.npmjs.com/package/iisexpress-proxy

TF400324: Team Foundation services are not available. Could not create SSL/TLS secure channel

TF400324:Team Foundation services are not available from server xxxx
Technical information (for administrator):
The request was aborted: Could not create SSL/TLS secure channel
Some of our developers are getting the error above whilst working with TFS but only after having Visual Studio open for about 5-10 minutes. We are currently working around this issue by closing and opening Visual Studio as it seems to be connecting fine just after openning.
Note that this is not all of our developers and all developers are on the latest version of visual studio version 15.9.1 and the TFS server is 2015.
Our tfs website where we manage our sprint boards is fine and the certificate is valid until 2020. We recently updated our certificate to a wildcard e.g. *.mywebsite.com.
What we have tried:
IIS Crypto 2.0 from Nartac Software to check Protocols/Ciphers on clients and servers
Clearing the TFS cache folders on the client machines
A complete fresh install of visual studio, sign in and connection to TFS
Regedit HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\v4.0.30319: SchUseStrongCrypto for both 32bit and 64 bit. Found here https://johnlouros.com/blog/enabling-strong-cryptography-for-all-dot-net-applications
Using a different microsoft login (also verified that mine works on other machines)
None of the above have solved the issue. What is puzzling me the most is that it works for a period of time before displaying the error, once the error has been displayed it seems that it never tries to reconnect to the TFS server so requires a fresh instance of visual studio before it attempts and successfully reconnects.
I found the answer here: https://developercommunity.visualstudio.com/content/problem/356394/tls-10-the-request-was-aborted-could-not-create-ss.html
The issue happens because VS 15.9 attempts to use system defaults for TLS handshake, but it is being to set to TLS1.2 somewhere within VS. While Microsoft works on a fix, you can work around this by setting this registry key
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319]
"SystemDefaultTlsVersions"=dword:00000000
This should force .net to use system defaults (rather than TLS 1.2) and that should help negotiate gracefully down to TLS 1.0 if the TFS server is set to support only TLS 1.0.
That worked for me for VS 15.9.3 just fine (needed to restart VS though).

Visual Studio Just-In-Time Debugger, stops Wamp Server

Please can someone help me, am getting this message whenever I start my windows 7 system:
Visual Studio Just-In-Time Debugger.
An unhandled exception ('System.IO.FileNotFoundException') occured in IAStorDataMgrSvc.exe [5824]. Just-In-Time debugging this exception failed with the following error: No installed debugger has Just-In-Time debugging enabled. In visual Studio, Just-In-Time debugging can be enabled from Tools/Options/Debugging/Just-In-Time.
I have uninstalled Visual Studio yet this challenge persists.
Because of the above error I can no longer properly use my wamp server.
Did you also install IIS when you installed Visual Studio.
IIS and the APache in WAMP are both web servers and both want to use TCP port 80. IIS is probably staring automatically and getting port 80 first so Apache cannot have it.
If you are not using IIS then uninstall it as well.
If you are then you will have to change IIS and probably some other bits so they dont start automaticaly. Do this on the Services dialog.
Ive got the same problem.
I dont know about the relationship betwin Visual studio and Wamp, and I somehow doubt its related, sence at the instal of VS2017 Ive had already instaled Wamp.
What I do know is that, even in offline instal mode this problem persists, my gues is that JustINtimeDebugger got locked.
My solution:
I killed the PowerShell.exe process (under vs_instalershell ) using File Explorer and install it later.
Note, this does not solve the problem it just bypass it.
Theoreticaly, next you should try to unlock the RegisterJustInTimeDebugger.ps1 file from C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualStudio.Debugger.JustInTime,version=15.0.26208.0 with (consider changing the path if needed):
Unblock-File -path "C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualStudio.Debugger.JustInTime,version=15.0.26208.0"
Altenative:
Update the System Variable __PSLockDownPolicy to 1 or delete it if it exists.
But I have failed to make it working even now.

Project migrated from old PC and from VS2010 to VS2012 "The wait operation timed out."

I just got a new Windows 7 computer with VS 2012. My old box was Windows XP with VS 2010. I copied over my project and had VS2012 upgrade the project and get the following error when running the ASP.NET MVC 3 application:
[Win32Exception (0x80004005): The wait operation timed out]
[SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed out.)]
[ProviderIncompatibleException: The provider did not return a ProviderManifestToken string.]
[ProviderIncompatibleException: An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct.]
That was the order of the messages. I am connecting through EntityFramework (code first). The connection string was working just fine in VS2010:
Data Source=xxx.xxx.xxx.xxx; User ID=xxxxxx; Password=xxxxxxxxx; Initial Catalog=xxxxxxxxx; MultipleActiveResultSets=true
I have been searching for hours with no real solution. The only one I haven't tried is to remove VS 2012 and .NET 4.5. That would be a problem since then I can't code. I have tried to remove .NET 4.5, but then VS2012 doesn't start. I have installed .NET 4.0.
I have installed (only listing software based on what I have see in searches):
VS 2012
Windows 7
SSMS 2010 (which was initially installed after VS 2012)
I have done a repair on VS2012 as well. I have not uninstalled and reinstalled it.
Any thoughts? I am going nuts here. Right now I have a quad-core pc that can remote desktop REALLY fast to my old clunker.
NOTE: My firewall is off. I have Symantec Endpoint Protection and this is connecting to a live SQL server, so I know it's running.
Amazingly, this worked:
netsh Winsock reset
See Can't connect to database after installing VS 11 Pro Beta

Resources