I have created an application in c# using visual studio 2019. When I released it, everything worked fine but the exe came out with 2 other files in the folder. I want to have just one exe that can run by itself, without any extra files in its location, so I tried the "self contained" option in the publish settings. It didn't work though. I only get an "error has occured" popup window that says this:
Publish has encountered an error.
Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.
A diagnostic log has been written to the following location:
"C:\Users\***\AppData\Local\Temp\tmp4E17.tmp"
And in the output box below I get this:
1>Determining projects to restore...
1>Unable to load the service index for source
https://api.nuget.org/v3/index.json.
1> An error occurred while sending the request.
1> The request was aborted: Could not create SSL/TLS secure
channel.
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped
==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
Now, I've seen some similar issues that people posted about this and some possible fixes, but nothing has worked for me. I have updated TLS 1.3->Client->DisabledByDefault value to 1 in regedit and it still didn't fix the problem.
I'm using system windows 7 (32-bit). I'm looking forward to any possible fixes, thank you in advance.
First, please check if the problem is related to network or VS IDE.
Please enter the link
https://api.nuget.org/v3/index.json
on the website and if you cannot open the website, I think the issue is related to your Internet and you should check your Internet and make sure that there is nothing else breaking it.If not, I think the issue is related to VS IDE. You should try the following steps:
1) disable any third party vs installed extensions under Extensions-->Manage Extensions to check if there is an extension cause that.
2) clean all nuget caches first or just delete all cache files under
C:\Users\xxx(current user)\.nuget\packages
3) enable only nuget.org nuget package source and disable the others.
Enter Tools-->Options-->Nuget Package Manager-->Package Sources
Uncheck the other package sources and only remain
nuget.org
.Besides, you can also change
nuget.org
package source ashttp://packages.nuget.org/v1/FeedService.svc/
orhttps://nuget.org/api/v2/
to test whether it can resore nuget packages.4) close VS, delete the global
nuget.config
file underC:\Users\xxx(current user)\AppData\Roaming\NuGet
. Then, restart your VS to regenerate the file, test again.5) run these under CMD( run as Administrator)
6) repair VS or update it to the latest version